From e5268075fb35ee51798dc31c0c17507d7ac4df91 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 28 Oct 2022 17:30:38 +0200 Subject: [PATCH] Fixed mouse button statuses in PS/2 mouse command E9. --- src/device/mouse_ps2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 24e8996c4..0fc731c33 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -128,12 +128,12 @@ ps2_write(uint8_t val, void *priv) case 0xe9: /* status request */ keyboard_at_adddata_mouse(0xfa); temp = (dev->flags & 0x30); - if (mouse_buttons & 0x01) - temp |= 0x01; - if (mouse_buttons & 0x02) - temp |= 0x02; - if (mouse_buttons & 0x04) - temp |= 0x03; + if (mouse_buttons & 1) + temp |= 4; + if (mouse_buttons & 2) + temp |= 1; + if ((mouse_buttons & 4) && (dev->flags & FLAG_INTELLI)) + temp |= 2; keyboard_at_adddata_mouse(temp); keyboard_at_adddata_mouse(dev->resolution); keyboard_at_adddata_mouse(dev->sample_rate);