Include dpad buttons in joystick detection (#6240)
authorhramrach <hramrach@gmail.com>
Fri, 30 Jun 2017 00:23:58 +0000 (02:23 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 30 Jun 2017 00:23:58 +0000 (10:23 +1000)
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

index d657937..01e56b2 100644 (file)
@@ -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);