aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2024-09-05 01:30:15 +0200
committerJavier <dev.git@javispedro.com>2024-09-05 01:30:15 +0200
commit58fe8e22096863f86b2916dd388401f7afc1d26c (patch)
tree3d03b8e51fe5fc272705cd67873737ec077247ee
parent076febba4f5e42604dac5eb46d7955a2e27c5dd5 (diff)
downloadvbados-master.tar.gz
vbados-master.zip
preserve the state of the 4th&5th buttons if we get a wheel movement packetHEADmaster
-rw-r--r--mousetsr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mousetsr.c b/mousetsr.c
index 75fc769..2913efd 100644
--- a/mousetsr.c
+++ b/mousetsr.c
@@ -766,10 +766,13 @@ static void handle_ps2_packet(void)
if (data.ps2_packet[3] & PS2M_IMEX_VERTICAL_SCROLL) {
// Vertical scrolling, with 6 bits of precision.
z = sign_extend(data.ps2_packet[3], 6);
+ // Assume 4th/5th buttons are still pressed if they were
+ buttons |= data.buttons & (INT33_BUTTON_MASK_4TH|INT33_BUTTON_MASK_5TH);
} else if (data.ps2_packet[3] & PS2M_IMEX_HORIZONTAL_SCROLL) {
// Horizontal scrolling, with 6 bits of precision.
z = sign_extend(data.ps2_packet[3], 6);
wheeln = 1;
+ buttons |= data.buttons & (INT33_BUTTON_MASK_4TH|INT33_BUTTON_MASK_5TH);
} else {
// Or 2 extra buttons (4, 5)
if (data.ps2_packet[3] & PS2M_IMEX_BUTTON_4) {