chiark / gitweb /
man: add static device nodes and udevd debug options
[elogind.git] / extras / input_id / input_id.c
index 05bb085a032d904c5f62614a071d5f3d6811a4bc..602c90d0c470c8396f72b01048553e41e6133aeb 100644 (file)
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <limits.h>
 #include <string.h>
 #include <stdlib.h>
 #include <limits.h>
+#include <linux/limits.h>
 #include <linux/input.h>
 
 #include "libudev.h"
 #include <linux/input.h>
 
 #include "libudev.h"
@@ -72,7 +73,10 @@ static void test_pointers (const unsigned long* bitmask_ev,
        int is_mouse = 0;
        int is_touchpad = 0;
 
        int is_mouse = 0;
        int is_touchpad = 0;
 
-       if (test_bit (EV_ABS, bitmask_ev) && test_bit (EV_KEY, bitmask_ev) &&
+       if (!test_bit (EV_KEY, bitmask_ev))
+               return;
+
+       if (test_bit (EV_ABS, bitmask_ev) &&
             test_bit (ABS_X, bitmask_abs) && test_bit (ABS_Y, bitmask_abs)) {
                if (test_bit (BTN_STYLUS, bitmask_key) || test_bit (BTN_TOOL_PEN, bitmask_key))
                        puts("ID_INPUT_TABLET=1");
             test_bit (ABS_X, bitmask_abs) && test_bit (ABS_Y, bitmask_abs)) {
                if (test_bit (BTN_STYLUS, bitmask_key) || test_bit (BTN_TOOL_PEN, bitmask_key))
                        puts("ID_INPUT_TABLET=1");
@@ -86,10 +90,13 @@ static void test_pointers (const unsigned long* bitmask_ev,
                        /* This path is taken by VMware's USB mouse, which has
                         * absolute axes, but no touch/pressure button. */
                        is_mouse = 1;
                        /* This path is taken by VMware's USB mouse, which has
                         * absolute axes, but no touch/pressure button. */
                        is_mouse = 1;
+               else if (test_bit (BTN_TOUCH, bitmask_key))
+                       puts("ID_INPUT_TOUCHSCREEN=1");
        }
 
        if (test_bit (EV_REL, bitmask_ev) && 
        }
 
        if (test_bit (EV_REL, bitmask_ev) && 
-            test_bit (REL_X, bitmask_rel) && test_bit (REL_Y, bitmask_rel))
+           test_bit (REL_X, bitmask_rel) && test_bit (REL_Y, bitmask_rel) &&
+           test_bit (BTN_MOUSE, bitmask_key))
                is_mouse = 1;
 
        if (is_mouse)
                is_mouse = 1;
 
        if (is_mouse)