Ignore joystick devices if LIBINPUT_IGNORE_JOYSTICK env is 1 16/103616/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170105.024651 accepted/tizen/3.0.m2/tv/20170105.024916 accepted/tizen/3.0.m2/wearable/20170105.025004 accepted/tizen/3.0/common/20161213.163331 accepted/tizen/3.0/ivi/20161213.023649 accepted/tizen/3.0/mobile/20161213.023613 accepted/tizen/3.0/tv/20161213.023619 accepted/tizen/3.0/wearable/20161213.023632 accepted/tizen/common/20161210.161905 accepted/tizen/ivi/20161212.023837 accepted/tizen/mobile/20161212.023736 accepted/tizen/tv/20161212.023747 accepted/tizen/unified/20170309.035948 accepted/tizen/wearable/20161212.023819 submit/tizen/20161209.063307 submit/tizen_3.0.m2/20170104.093753 submit/tizen_3.0/20161209.063130 submit/tizen_unified/20170308.100414
authorJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 9 Dec 2016 02:51:58 +0000 (11:51 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 9 Dec 2016 02:51:58 +0000 (11:51 +0900)
Change-Id: I56d9cc833acad212e3d8071a79adf27bc29c19ca

src/evdev.c

index 951b76827adaa108814203b688571cfc001e45a9..d6dcd3b772fd1fdcc30afc22e1f9c0f238c6795b 100644 (file)
@@ -1517,6 +1517,7 @@ evdev_configure_device(struct evdev_device *device)
        int slot;
        const char *devnode = udev_device_get_devnode(device->udev_device);
        enum evdev_device_udev_tags udev_tags;
+       char *env;
 
        udev_tags = evdev_device_get_udev_tags(device, device->udev_device);
 
@@ -1541,11 +1542,22 @@ evdev_configure_device(struct evdev_device *device)
 
        /* libwacom *adds* TABLET, TOUCHPAD but leaves JOYSTICK in place, so
           make sure we only ignore real joystick devices */
-       if ((udev_tags & EVDEV_UDEV_TAG_JOYSTICK) == udev_tags) {
-               log_info(libinput,
-                        "input device '%s', %s is a joystick, ignoring\n",
-                        device->devname, devnode);
-               return -1;
+       if (udev_tags & EVDEV_UDEV_TAG_JOYSTICK) {
+               env = getenv("LIBINPUT_IGNORE_JOYSTICK");
+               if (env && atoi(env) == 1) {
+                       log_info(libinput,
+                                "input device '%s', %s have joystick, ignoring\n",
+                                device->devname, devnode);
+                               return -1;
+               }
+               else {
+                       if ((udev_tags & EVDEV_UDEV_TAG_JOYSTICK) == udev_tags) {
+                               log_info(libinput,
+                                        "input device '%s', %s is a joystick, ignoring\n",
+                                        device->devname, devnode);
+                               return -1;
+                       }
+               }
        }
 
        device->abs.absinfo_orientation = libevdev_get_abs_info(evdev, ABS_MT_ORIENTATION);