OSDN Git Service

BTN_TOUCH is only *required* when the device isn't able to measure pressure,
authorChris Larson <clarson@kergoth.com>
Tue, 11 Nov 2008 21:27:07 +0000 (21:27 +0000)
committerChris Larson <clarson@kergoth.com>
Tue, 11 Nov 2008 21:27:07 +0000 (21:27 +0000)
since we can also infer a press/release from the pressure value.

Signed-off-by: Chris Larson <clarson@kergoth.com>
plugins/input-raw.c

index 9e2ea60..d342dc7 100644 (file)
@@ -94,13 +94,14 @@ static int check_fd(struct tslib_input *i)
        we set it to constant 255. It's still controlled by BTN_TOUCH - when not
        touched, the pressure is forced to 0. */
 
-       if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE)))
+       if (!(absbit[BIT_WORD(ABS_PRESSURE)] & BIT_MASK(ABS_PRESSURE))) {
                i->current_p = 255;
 
-       if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) ||
-               !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) {
-               fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n");
-               return -1;
+               if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, KEY_CNT), keybit) < 0) ||
+                       !(absbit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) {
+                       fprintf(stderr, "selected device uses is not a touchscreen (must support BTN_TOUCH events)\n");
+                       return -1;
+               }
        }
 
        if (evbit[BIT_WORD(EV_SYN)] & BIT_MASK(EV_SYN))