From: Peter Hutterer Date: Wed, 21 Jun 2017 23:11:15 +0000 (+1000) Subject: udev: consider a device with BTN_TRIGGER_HAPPY as joystick X-Git-Tag: v234~117^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c874fed3481638155a23601ce65985b2d0283e9c;p=thirdparty%2Fsystemd.git udev: consider a device with BTN_TRIGGER_HAPPY as joystick 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. https://github.com/systemd/systemd/issues/6137 Signed-off-by: Peter Hutterer --- diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index 4303b2593d3..7ea86b21b89 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -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) ||