Example #1
0
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));
}
Example #2
0
static void
touchpad_tap_handle_event(struct touchpad *tp, enum tap_event event, void *userdata)
{
	argcheck_int_range(event, TAP_EVENT_TOUCH, TAP_EVENT_TIMEOUT);

	if (!tp->tap.config.enabled)
		return;

	switch(tp->tap.state) {
		case TAP_STATE_IDLE:
			touchpad_tap_idle_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_TOUCH:
			touchpad_tap_touch_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_HOLD:
			touchpad_tap_hold_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_TAPPED:
			touchpad_tap_tapped_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_TOUCH_2:
			touchpad_tap_touch2_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_TOUCH_2_HOLD:
			touchpad_tap_touch2_hold_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_TOUCH_3:
			touchpad_tap_touch3_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_TOUCH_3_HOLD:
			touchpad_tap_touch3_hold_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_DRAGGING_OR_DOUBLETAP:
			touchpad_tap_dragging_or_doubletap_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_DRAGGING:
			touchpad_tap_dragging_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_DRAGGING_WAIT:
			touchpad_tap_dragging_wait_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_DRAGGING_2:
			touchpad_tap_dragging2_handle_event(tp, event, userdata);
			break;
		case TAP_STATE_DEAD:
			touchpad_tap_dead_handle_event(tp, event, userdata);
			break;
	}
	if (tp->tap.state == TAP_STATE_IDLE || tp->tap.state == TAP_STATE_DEAD)
		touchpad_tap_clear_timer(tp, userdata);

}