dinput: Detect more buttons as non-joysticks.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2019-10-21 22:42:31 +00:00 committed by Alexandre Julliard
parent 524783dfeb
commit 1dfc36c379
1 changed files with 5 additions and 4 deletions

View File

@ -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;
}