aboutsummaryrefslogtreecommitdiff
path: root/mousetsr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mousetsr.c')
-rw-r--r--mousetsr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mousetsr.c b/mousetsr.c
index dad4229..6ca7cd7 100644
--- a/mousetsr.c
+++ b/mousetsr.c
@@ -764,7 +764,7 @@ static void handle_ps2_packet(void)
z = sign_extend(data.ps2_packet[3], 6);
} 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);
+ z = -sign_extend(data.ps2_packet[3], 6);
wheeln = 1;
} else {
// Or 2 extra buttons (4, 5)
@@ -1047,10 +1047,6 @@ static void reset_mouse_hardware()
ps2m_get_device_id(&data.device_id);
if (data.device_id == PS2M_DEVICE_ID_IMEX) {
- dputs("ImEx detected");
- data.num_wheels = 2;
- data.num_buttons = 5;
-
ps2m_send_imex_horz_sequence();
ps2m_get_device_id(&data.device_id);
@@ -1059,7 +1055,14 @@ static void reset_mouse_hardware()
// handle both protocols is the same.
}
}
-#endif
+
+ if (data.device_id == PS2M_DEVICE_ID_IMEX
+ || data.device_id == PS2M_DEVICE_ID_IMEX_HORZ) {
+ dputs("ImEx detected");
+ data.num_wheels = 2;
+ data.num_buttons = 5;
+ }
+#endif /* USE_IMEX */
dprintf("found mouse device id = 0x%hx\n", data.device_id);
} else {