kernel: Fix negative movement in the PS/2 mouse driver

This commit is contained in:
apio 2023-08-03 12:18:30 +02:00
parent b01aa72f17
commit 7076ff2f6b
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -43,8 +43,8 @@ static void process_mouse_event(u8 data)
packet.buttons = 0;
u8 flags = g_mouse_packet[0];
if (flags & PS2_MOUSE_X_SIGN) packet.xdelta = -packet.xdelta;
if (flags & PS2_MOUSE_Y_SIGN) packet.ydelta = -packet.ydelta;
if (flags & PS2_MOUSE_X_SIGN) packet.xdelta = -(256 - packet.xdelta);
if (flags & PS2_MOUSE_Y_SIGN) packet.ydelta = -(256 - packet.ydelta);
if (flags & PS2_MOUSE_MIDDLE_BTN) packet.buttons |= moon::MouseButton::Middle;
if (flags & PS2_MOUSE_RIGHT_BTN) packet.buttons |= moon::MouseButton::Right;