feat(kernel): Add USB devicde and keyboard/mouse support

This commit is contained in:
2026-02-19 23:06:18 +01:00
parent 9ca51596ea
commit 5810306e14
21 changed files with 2377 additions and 24 deletions
+17
View File
@@ -196,4 +196,21 @@ namespace Drivers::PS2::Mouse {
g_MaxY = maxY;
}
void InjectMouseReport(uint8_t buttons, int8_t deltaX, int8_t deltaY, int8_t scroll) {
g_StateLock.Acquire();
g_State.X += (int32_t)deltaX;
g_State.Y += (int32_t)deltaY;
g_State.Buttons = buttons;
g_State.ScrollDelta = (int32_t)scroll;
// Clamp to screen bounds
if (g_State.X < 0) g_State.X = 0;
if (g_State.Y < 0) g_State.Y = 0;
if (g_State.X > g_MaxX) g_State.X = g_MaxX;
if (g_State.Y > g_MaxY) g_State.Y = g_MaxY;
g_StateLock.Release();
}
};