28 static void update_data0_fields(
int index,
int group_index,
const touch_event_t* event);
49 update_double_taps(taps + event->
group, event);
64 int complete_index = -1;
88 switch (d_tap.
state) {
97 time_diff =
event->t - d_tap.
t0;
123 float group_time_diff =
tap->
t - d_tap.
t0;
153 if (null_index != -1) {
155 update_data0_fields(null_index, group_index, event);
156 }
else if (complete_index != -1) {
157 update_data0_fields(complete_index, group_index, event);
171 static void update_data0_fields(
int index,
int group_index,
const touch_event_t* event) {
177 if (group_index != -1) {
const double_tap_t * get_double_tap()
returns an array of the ongoing double_touch data for each finger
void recognize_double_tap(const touch_event_t *event)
reads the last tap and stroke data and determines whethers this new stroke is part of a double_tap ev...
void init_double_tap()
initializes the data array by setting all field to 0/NULL
void(* on_double_tap)(const double_tap_t *)=0
double_tap_t double_tap_d[MAX_TOUCHES]
int set_on_double_tap(void(*listener)(const double_tap_t *))
Listen to double_tap events.
float DOUBLE_GROUP_DIST_DIFF
float DOUBLE_GROUP_TIME_DIFF
@ RECOGNIZER_STATE_FAILED
@ RECOGNIZER_STATE_COMPLETED
@ RECOGNIZER_STATE_POSSIBLE
holds the state, last location, and timestamp of a double tap instance
Data structure for tap data.
To use the gesture library, users create touch events and fill in the appropriate fields.
const tap_t * get_tap()
Access tap data array of size MAX_TOUCHES.
#define SQU_DIST(x, y, x0, y0)
#define SQUARED_DIST_0(a, b)