diff options
author | Klesh Wong <klesh@qq.com> | 2022-11-14 00:07:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 03:07:08 +1100 |
commit | 133fe1c013d712522fc8ae159567629ef7760ed6 (patch) | |
tree | cfd824b4c599363ed8105296d56979d1aa87dc29 /drivers/ps2 | |
parent | 6c4e6a86f75e39babc4679813f3bad7bbc1d653e (diff) |
fix: mousekey doesn't work with trackpoint (#18474)
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'drivers/ps2')
-rw-r--r-- | drivers/ps2/ps2_mouse.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ps2/ps2_mouse.c b/drivers/ps2/ps2_mouse.c index 66b48bb3c3..b32ad1e222 100644 --- a/drivers/ps2/ps2_mouse.c +++ b/drivers/ps2/ps2_mouse.c @@ -80,7 +80,7 @@ void ps2_mouse_task(void) { uint8_t rcv; rcv = ps2_host_send(PS2_MOUSE_READ_DATA); if (rcv == PS2_ACK) { - mouse_report.buttons = ps2_host_recv_response() | tp_buttons; + mouse_report.buttons = ps2_host_recv_response(); mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER; mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER; # ifdef PS2_MOUSE_ENABLE_SCROLLING @@ -88,11 +88,10 @@ void ps2_mouse_task(void) { # endif } else { if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n"); - return; } #else if (pbuf_has_data()) { - mouse_report.buttons = ps2_host_recv_response() | tp_buttons; + mouse_report.buttons = ps2_host_recv_response(); mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER; mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER; # ifdef PS2_MOUSE_ENABLE_SCROLLING @@ -100,10 +99,10 @@ void ps2_mouse_task(void) { # endif } else { if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n"); - return; } #endif + mouse_report.buttons |= tp_buttons; /* if mouse moves or buttons state changes */ if (mouse_report.x || mouse_report.y || mouse_report.v || ((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) { #ifdef PS2_MOUSE_DEBUG_RAW |