aboutsummaryrefslogtreecommitdiff
path: root/mousetsr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mousetsr.c')
-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) {