}
static void
-send_btntool(struct litest_device *d)
+send_btntool(struct litest_device *d, bool hover)
{
- litest_event(d, EV_KEY, BTN_TOUCH, d->ntouches_down != 0);
+ litest_event(d, EV_KEY, BTN_TOUCH, d->ntouches_down != 0 && !hover);
litest_event(d, EV_KEY, BTN_TOOL_FINGER, d->ntouches_down == 1);
litest_event(d, EV_KEY, BTN_TOOL_DOUBLETAP, d->ntouches_down == 2);
litest_event(d, EV_KEY, BTN_TOOL_TRIPLETAP, d->ntouches_down == 3);
assert(d->ntouches_down >= 0);
d->ntouches_down++;
- send_btntool(d);
+ send_btntool(d, !touching);
if (d->interface->touch_down) {
d->interface->touch_down(d, slot, x, y);
litest_assert_int_gt(d->ntouches_down, 0);
d->ntouches_down--;
- send_btntool(d);
+ send_btntool(d, false);
if (d->interface->touch_up) {
d->interface->touch_up(d, slot);
litest_assert_int_gt(d->ntouches_down, 0);
d->ntouches_down--;
- send_btntool(d);
+ send_btntool(d, true);
if (d->interface->touch_up) {
d->interface->touch_up(d, slot);