Skip to content

Commit

Permalink
udev: always consider devices with joystick axes/buttons as joystick
Browse files Browse the repository at this point in the history
Even when they don't have an x/y axis.

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 98fc7bc commit 46d9536
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/udev/udev-builtin-input_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static bool test_pointers(struct udev_device *dev,
has_touch = test_bit(BTN_TOUCH, bitmask_key);
/* joysticks don't necessarily have buttons; e. g.
* rudders/pedals are joystick-like, but buttonless; they have
* other fancy axes */
* other fancy axes. Others have buttons only but no 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) ||
Expand All @@ -231,7 +231,10 @@ static bool test_pointers(struct udev_device *dev,
is_touchscreen = true;
else if (has_joystick_axes_or_buttons)
is_joystick = true;
} else if (has_joystick_axes_or_buttons) {
is_joystick = true;
}

if (has_mt_coordinates) {
if (stylus_or_pen)
is_tablet = true;
Expand Down

0 comments on commit 46d9536

Please sign in to comment.