OSDN Git Service

ts_calibrate: Accept touchscreens using BTN_MOUSE events instead of BTN_TOUCH
authorGernot Hillier <gernot.hillier@siemens.com>
Mon, 30 Apr 2012 14:38:49 +0000 (16:38 +0200)
committerGernot Hillier <gernot.hillier@siemens.com>
Mon, 30 Apr 2012 14:38:49 +0000 (16:38 +0200)
ts_input_read was already extended to accept BTN_MOUSE events, however
some startup checks in check_fd() were not extended accordingly.

plugins/input-raw.c

index 4756d62..4df4c89 100644 (file)
@@ -111,8 +111,9 @@ static int check_fd(struct tslib_input *i)
                i->current_p = 255;
 
                if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
-                       !(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) ) {
-                       fprintf(stderr, "tslib: Selected device is not a touchscreen (must support BTN_TOUCH events)\n");
+                       ( !(keybit[BIT_WORD(BTN_TOUCH)] & BIT_MASK(BTN_TOUCH)) &&
+                         !(keybit[BIT_WORD(BTN_MOUSE)] & BIT_MASK(BTN_MOUSE)) ) ) {
+                       fprintf(stderr, "tslib: Selected device is not a touchscreen (must support BTN_TOUCH or BTN_MOUSE events)\n");
                        return -1;
                }
        }