diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-26 10:43:26 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-29 10:41:03 -0700 |
commit | fb5a7434060b24b56b284bf429d0ef354c4aab22 (patch) | |
tree | c6405139721c7951a0a9a810b0c9d458ca3f0107 /src | |
parent | 4f83c8a62b2f93680e8bf906cc2881d97e968e2f (diff) | |
download | weston-fb5a7434060b24b56b284bf429d0ef354c4aab22.tar.gz weston-fb5a7434060b24b56b284bf429d0ef354c4aab22.tar.bz2 weston-fb5a7434060b24b56b284bf429d0ef354c4aab22.zip |
evdev: Suport old-style single-touch touch screens
These screens send only BTN_TOUCH and ABS_X/Y.
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c index dd3e2c9f..5ad4d6b1 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -83,6 +83,11 @@ evdev_process_key(struct evdev_device *device, struct input_event *e, int time) WL_POINTER_BUTTON_STATE_RELEASED); break; + case BTN_TOUCH: + if (e->value == 0 && !device->is_mt) + notify_touch(device->seat, time, device->mt.slot, 0, 0, + WL_TOUCH_UP); + break; default: notify_key(device->seat, time, e->code, @@ -295,7 +300,16 @@ evdev_flush_motion(struct evdev_device *device, uint32_t time) weston_output_transform_coordinate(device->output, device->abs.x, device->abs.y, &x, &y); - notify_motion_absolute(master, time, x, y); + + if (device->caps & EVDEV_TOUCH) { + if (master->num_tp == 0) + notify_touch(master, time, 0, + x, y, WL_TOUCH_DOWN); + else + notify_touch(master, time, 0, + x, y, WL_TOUCH_MOTION); + } else + notify_motion_absolute(master, time, x, y); device->pending_events &= ~EVDEV_ABSOLUTE_MOTION; } } @@ -482,6 +496,10 @@ evdev_handle_device(struct evdev_device *device) break; } } + if (TEST_BIT(key_bits, BTN_TOUCH)) { + device->caps |= EVDEV_TOUCH; + } + } if (TEST_BIT(ev_bits, EV_LED)) { device->caps |= EVDEV_KEYBOARD; |