Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
t->state = TOUCH_BEGIN;
tp->nfingers_down++;
assert(tp->nfingers_down >= 1);
+ tp->queued |= TOUCHPAD_EVENT_MOTION;
}
}
t->state = TOUCH_END;
assert(tp->nfingers_down >= 1);
tp->nfingers_down--;
+ tp->queued |= TOUCHPAD_EVENT_MOTION;
}
static double
t->x = e->value;
t->millis = time;
t->dirty = true;
+ tp->queued |= TOUCHPAD_EVENT_MOTION;
break;
case ABS_MT_POSITION_Y:
t->y = e->value;
t->millis = time;
t->dirty = true;
+ tp->queued |= TOUCHPAD_EVENT_MOTION;
break;
case ABS_MT_SLOT:
tp->slot = e->value;
t->dirty = false;
}
+
+ tp->queued = TOUCHPAD_EVENT_NONE;
}
static void
#define TOUCHPAD_HISTORY_LENGTH 4
+enum touchpad_event {
+ TOUCHPAD_EVENT_NONE = 0,
+ TOUCHPAD_EVENT_MOTION = (1 << 0),
+ TOUCHPAD_EVENT_BUTTON_PRESS = (1 << 1),
+ TOUCHPAD_EVENT_BUTTON_RELEASE = (1 << 2),
+};
+
enum touch_state {
TOUCH_NONE = 0,
TOUCH_BEGIN,
double min_factor;
double max_factor;
} accel;
+
+ enum touchpad_event queued;
};
#define tp_for_each_touch(_tp, _t) \