CASE_RETURN_STRING(TAP_STATE_TOUCH_2_RELEASE);
CASE_RETURN_STRING(TAP_STATE_TOUCH_3);
CASE_RETURN_STRING(TAP_STATE_TOUCH_3_HOLD);
+ CASE_RETURN_STRING(TAP_STATE_TOUCH_3_RELEASE);
+ CASE_RETURN_STRING(TAP_STATE_TOUCH_3_RELEASE_2);
CASE_RETURN_STRING(TAP_STATE_DRAGGING);
CASE_RETURN_STRING(TAP_STATE_DRAGGING_WAIT);
CASE_RETURN_STRING(TAP_STATE_DRAGGING_OR_DOUBLETAP);
LIBINPUT_BUTTON_STATE_PRESSED);
if (tp->tap.drag_enabled) {
tp->tap.state = TAP_STATE_TAPPED;
- tp->tap.saved_release_time = time;
tp_tap_set_timer(tp, time);
} else {
tp_tap_notify(tp,
- time,
+ tp->tap.saved_release_time,
1,
LIBINPUT_BUTTON_STATE_RELEASED);
tp->tap.state = TAP_STATE_IDLE;
tp_tap_clear_timer(tp);
break;
case TAP_EVENT_RELEASE:
- tp->tap.state = TAP_STATE_TOUCH_2_HOLD;
- if (t->tap.state == TAP_TOUCH_STATE_TOUCH) {
- tp_tap_notify(tp,
- tp->tap.saved_press_time,
- 3,
- LIBINPUT_BUTTON_STATE_PRESSED);
- tp_tap_notify(tp, time, 3, LIBINPUT_BUTTON_STATE_RELEASED);
- }
+ tp->tap.state = TAP_STATE_TOUCH_3_RELEASE;
+ tp->tap.saved_release_time = time;
+ tp_tap_set_timer(tp, time);
break;
case TAP_EVENT_BUTTON:
tp->tap.state = TAP_STATE_DEAD;
}
}
+static void
+tp_tap_touch3_release_handle_event(struct tp_dispatch *tp,
+ struct tp_touch *t,
+ enum tap_event event, uint64_t time)
+{
+
+ switch (event) {
+ case TAP_EVENT_TOUCH:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp->tap.state = TAP_STATE_TOUCH_3;
+ tp->tap.saved_press_time = time;
+ tp_tap_set_timer(tp, time);
+ break;
+ case TAP_EVENT_RELEASE:
+ tp->tap.state = TAP_STATE_TOUCH_3_RELEASE_2;
+ tp_tap_set_timer(tp, time);
+ break;
+ case TAP_EVENT_MOTION:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp_tap_move_to_dead(tp, t);
+ break;
+ case TAP_EVENT_TIMEOUT:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp->tap.state = TAP_STATE_TOUCH_2_HOLD;
+ break;
+ case TAP_EVENT_BUTTON:
+ tp->tap.state = TAP_STATE_DEAD;
+ break;
+ case TAP_EVENT_THUMB:
+ break;
+ case TAP_EVENT_PALM:
+ tp->tap.state = TAP_STATE_TOUCH_2_RELEASE;
+ break;
+ case TAP_EVENT_PALM_UP:
+ break;
+ }
+}
+
+static void
+tp_tap_touch3_release2_handle_event(struct tp_dispatch *tp,
+ struct tp_touch *t,
+ enum tap_event event, uint64_t time)
+{
+
+ switch (event) {
+ case TAP_EVENT_TOUCH:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp->tap.state = TAP_STATE_TOUCH_2;
+ tp->tap.saved_press_time = time;
+ tp_tap_set_timer(tp, time);
+ break;
+ case TAP_EVENT_RELEASE:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp->tap.state = TAP_STATE_IDLE;
+ break;
+ case TAP_EVENT_MOTION:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp_tap_move_to_dead(tp, t);
+ break;
+ case TAP_EVENT_TIMEOUT:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 3,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp->tap.state = TAP_STATE_HOLD;
+ break;
+ case TAP_EVENT_BUTTON:
+ tp->tap.state = TAP_STATE_DEAD;
+ break;
+ case TAP_EVENT_THUMB:
+ break;
+ case TAP_EVENT_PALM:
+ tp_tap_notify(tp,
+ tp->tap.saved_press_time,
+ 2,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ tp_tap_notify(tp,
+ tp->tap.saved_release_time,
+ 2,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ tp->tap.state = TAP_STATE_IDLE;
+ break;
+ case TAP_EVENT_PALM_UP:
+ break;
+ }
+}
+
static void
tp_tap_dragging_or_doubletap_handle_event(struct tp_dispatch *tp,
struct tp_touch *t,
case TAP_STATE_TOUCH_3_HOLD:
tp_tap_touch3_hold_handle_event(tp, t, event, time);
break;
+ case TAP_STATE_TOUCH_3_RELEASE:
+ tp_tap_touch3_release_handle_event(tp, t, event, time);
+ break;
+ case TAP_STATE_TOUCH_3_RELEASE_2:
+ tp_tap_touch3_release2_handle_event(tp, t, event, time);
+ break;
case TAP_STATE_DRAGGING_OR_DOUBLETAP:
tp_tap_dragging_or_doubletap_handle_event(tp, t, event, time);
break;