This fixes the problem with OLPC touchscreen which does not generate BTN_TOUCH (but reports that it has it), instead if generates ABS_MT_TRACKING_ID=-1 when the finger is offscreen. diff --git a/plugins/input-raw.c b/plugins/input-raw.c index 10454da..e1c8c02 100644 --- a/plugins/input-raw.c +++ b/plugins/input-raw.c @@ -43,6 +43,8 @@ #ifndef ABS_MT_POSITION_X # define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */ # define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ +# define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ +# define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ #endif #include "tslib-private.h" @@ -107,7 +109,9 @@ static int check_fd(struct tslib_input *i) we set it to constant 255. It's still controlled by BTN_TOUCH/BTN_LEFT - 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))==0 && + (absbit[BIT_WORD(ABS_MT_PRESSURE)] & BIT_MASK(ABS_MT_PRESSURE))==0 + ) { i->current_p = 255; if ((ioctl(ts->fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || @@ -204,8 +208,12 @@ static int ts_input_read(struct tslib_module_info *inf, i->current_y = ev.value; break; case ABS_PRESSURE: + case ABS_MT_PRESSURE: i->current_p = ev.value; break; + case ABS_MT_TRACKING_ID: + if (ev.value == -1) i->current_p=0; + break; } break; }