static void touchpad_tap_handle_event(struct touchpad *tp, enum tap_event event) { assert(event >= TAP_EVENT_NONE); printf("tap state: %s to ", tap_state_to_str(tp->tap.state)); switch(tp->tap.state) { case TAP_STATE_IDLE: touchpad_tap_idle_handle_event(tp, event); break; case TAP_STATE_TOUCH: touchpad_tap_touch_handle_event(tp, event); break; case TAP_STATE_TAPPED: touchpad_tap_tapped_handle_event(tp, event); break; case TAP_STATE_TOUCH_2: touchpad_tap_touch2_handle_event(tp, event); break; case TAP_STATE_TOUCH_3: touchpad_tap_touch3_handle_event(tp, event); break; case TAP_STATE_DRAGGING: touchpad_tap_dragging_handle_event(tp, event); break; default: assert(1); break; } printf("%s\n", tap_state_to_str(tp->tap.state)); }
static void tp_tap_handle_event(struct tp_dispatch *tp, struct tp_touch *t, enum tap_event event, uint64_t time) { enum tp_tap_state current; current = tp->tap.state; switch(tp->tap.state) { case TAP_STATE_IDLE: tp_tap_idle_handle_event(tp, t, event, time); break; case TAP_STATE_TOUCH: tp_tap_touch_handle_event(tp, t, event, time); break; case TAP_STATE_HOLD: tp_tap_hold_handle_event(tp, t, event, time); break; case TAP_STATE_TAPPED: tp_tap_tapped_handle_event(tp, t, event, time); break; case TAP_STATE_TOUCH_2: tp_tap_touch2_handle_event(tp, t, event, time); break; case TAP_STATE_TOUCH_2_HOLD: tp_tap_touch2_hold_handle_event(tp, t, event, time); break; case TAP_STATE_TOUCH_2_RELEASE: tp_tap_touch2_release_handle_event(tp, t, event, time); break; case TAP_STATE_TOUCH_3: tp_tap_touch3_handle_event(tp, t, event, time); break; case TAP_STATE_TOUCH_3_HOLD: tp_tap_touch3_hold_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; case TAP_STATE_DRAGGING: tp_tap_dragging_handle_event(tp, t, event, time); break; case TAP_STATE_DRAGGING_WAIT: tp_tap_dragging_wait_handle_event(tp, t, event, time); break; case TAP_STATE_DRAGGING_OR_TAP: tp_tap_dragging_tap_handle_event(tp, t, event, time); break; case TAP_STATE_DRAGGING_2: tp_tap_dragging2_handle_event(tp, t, event, time); break; case TAP_STATE_MULTITAP: tp_tap_multitap_handle_event(tp, t, event, time); break; case TAP_STATE_MULTITAP_DOWN: tp_tap_multitap_down_handle_event(tp, t, event, time); break; case TAP_STATE_DEAD: tp_tap_dead_handle_event(tp, t, event, time); break; } if (tp->tap.state == TAP_STATE_IDLE || tp->tap.state == TAP_STATE_DEAD) tp_tap_clear_timer(tp); evdev_log_debug(tp->device, "tap state: %s → %s → %s\n", tap_state_to_str(current), tap_event_to_str(event), tap_state_to_str(tp->tap.state)); }