]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: always consider devices with joystick axes/buttons as joystick 6170/head
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 21 Jun 2017 23:19:32 +0000 (09:19 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 21 Jun 2017 23:19:53 +0000 (09:19 +1000)
Even when they don't have an x/y axis.

https://github.com/systemd/systemd/issues/6137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/udev/udev-builtin-input_id.c

index 7ea86b21b8972616783e4eed1441e24604167bcb..47f41a660757869eed260000adaef4abe71e7957 100644 (file)
@@ -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) ||
@@ -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;