Skip to content

Commit

Permalink
udev: consider a device with BTN_TRIGGER_HAPPY as joystick
Browse files Browse the repository at this point in the history
These buttons were added specifically for joysticks with lots of buttons, no
other device should be using them. See kernel commit
cf2f765f18960 "HID: handle joysticks with large number of buttons"

We only test for BTN_TRIGGER_HAPPY (an alias for BTN_TRIGGER_HAPPY1) here, a
device that sets buttons 2 and above but doesn't set 1 is considered buggy.

systemd/systemd#6137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot authored and fredollinger committed Jun 30, 2017
1 parent acc4151 commit 98fc7bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/udev/udev-builtin-input_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ static bool test_pointers(struct udev_device *dev,
* rudders/pedals are joystick-like, but buttonless; they have
* other fancy axes */
has_joystick_axes_or_buttons = test_bit(BTN_TRIGGER, bitmask_key) ||
test_bit(BTN_TRIGGER_HAPPY, bitmask_key) ||
test_bit(BTN_A, bitmask_key) ||
test_bit(BTN_1, bitmask_key) ||
test_bit(ABS_RX, bitmask_abs) ||
Expand Down

0 comments on commit 98fc7bc

Please sign in to comment.