Include dpad buttons in joystick detection (#6240)

Since f472d466ec ("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.
This commit is contained in:
hramrach 2017-06-30 02:23:58 +02:00 committed by Peter Hutterer
parent 16a5d4128f
commit b876bc09b1

View 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);