From eb896e11aacab5f53e3915a8d19ffffd92ce8e10 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 20 Jul 2010 15:39:08 +0200 Subject: Touch API changes Add touch time to the touch frame (Thanks Rafi) Add touch change counters to the touch frame Add event bypass callback Signed-off-by: Henrik Rydberg --- test/touch.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/touch.c') diff --git a/test/touch.c b/test/touch.c index 48b2f12..1f9213d 100644 --- a/test/touch.c +++ b/test/touch.c @@ -28,11 +28,17 @@ #include #include -static void tp_sync(struct touch_engine *engine, touch_time_t time) +static void tp_event(struct touch_engine *engine, + const struct input_event *ev) +{ + fprintf(stderr, "event %d %d %d\n", ev->type, ev->code, ev->value); +} + +static void tp_sync(struct touch_engine *engine) { struct touch_frame *frame = &engine->frame; int slot, i; - fprintf(stderr, "sync %d %lld\n", frame->ntouch, time); + fprintf(stderr, "sync %d %lld\n", frame->ntouch, frame->time); for (slot = frame->slot; slot >= 0; slot = next_slot(frame, slot)) { struct touch *touch = &frame->touch[slot]; fprintf(stderr, "touch %d\n", slot); @@ -44,7 +50,7 @@ static void tp_sync(struct touch_engine *engine, touch_time_t time) static void loop_device(struct touch_dev *dev, int fd) { struct touch_engine engine; - touch_engine_init(&engine, tp_sync, 0); + touch_engine_init(&engine, tp_event, tp_sync, 0); touch_engine_attach(&engine, dev); while (!touch_dev_idle(dev, fd, 5000)) touch_dev_pull(dev, fd); -- cgit v1.2.3