From 1dfc36c379c9c4b9dc346961af38042a8bc99ffb Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 21 Oct 2019 22:42:31 +0000 Subject: [PATCH] dinput: Detect more buttons as non-joysticks. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Alexandre Julliard --- dlls/dinput/joystick_linux.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index e0c13319373..afdf659b4a5 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -168,7 +168,7 @@ static INT find_joystick_devices(void) struct JoyDev joydev, *new_joydevs; BYTE axes_map[ABS_MAX + 1]; SHORT btn_map[KEY_MAX - BTN_MISC + 1]; - BOOL is_stylus = FALSE; + BOOL non_js = FALSE; snprintf(joydev.device, sizeof(joydev.device), "%s%d", JOYDEV_NEW, i); if ((fd = open(joydev.device, O_RDONLY)) == -1) @@ -242,8 +242,9 @@ static INT find_joystick_devices(void) case BTN_DEAD: joydev.is_joystick = TRUE; break; + case BTN_MOUSE: case BTN_STYLUS: - is_stylus = TRUE; + non_js = TRUE; break; default: break; @@ -251,9 +252,9 @@ static INT find_joystick_devices(void) } } - if(is_stylus) + if(non_js) { - TRACE("Stylus detected. Skipping\n"); + TRACE("Non-joystick detected. Skipping\n"); close(fd); continue; }