From b876bc09b1de7805e3b71b682f883896bf82b42c Mon Sep 17 00:00:00 2001 From: hramrach Date: Fri, 30 Jun 2017 02:23:58 +0200 Subject: [PATCH] Include dpad buttons in joystick detection (#6240) Since f472d466ec26 ("Remove BTN_DPAD_* keys from ID_INPUT_KEY test (#5701)") dpad buttons are excluded from keyboard keys for keyboard detection. Include them in joystick buttons for joystick detection. --- src/udev/udev-builtin-input_id.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index d6579374b7..01e56b26f3 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -211,6 +211,8 @@ static bool test_pointers(struct udev_device *dev, has_joystick_axes_or_buttons = test_bit(button, bitmask_key); for (button = BTN_TRIGGER_HAPPY1; button <= BTN_TRIGGER_HAPPY40 && !has_joystick_axes_or_buttons; button++) has_joystick_axes_or_buttons = test_bit(button, bitmask_key); + for (button = BTN_DPAD_UP; button <= BTN_DPAD_RIGHT && !has_joystick_axes_or_buttons; button++) + has_joystick_axes_or_buttons = test_bit(button, bitmask_key); for (axis = ABS_RX; axis < ABS_PRESSURE && !has_joystick_axes_or_buttons; axis++) has_joystick_axes_or_buttons = test_bit(axis, bitmask_abs);