Gesture Library
double.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gesturelib.h"
4 #include "gestureparams.h"
5 #include "math.h"
6 #include "multistroke.h"
7 #include "recognizer.h"
8 #include "stroke.h"
9 #include "tap.h"
10 
11 // test defines to fix the distance problem
12 #define DIST_X 20
13 #define DIST_Y 20
14 
16 typedef struct double_tap {
18 
19  int group;
20 
21  // int num_touches;
22 
23  float x0;
24  float y0;
25  float t0;
26  float x;
27  float y;
28  float t;
29 } double_tap_t; // single finger double tap data
30 
32 void init_double_tap();
33 
36 void recognize_double_tap(const touch_event_t* event);
37 
41 
45 int set_on_double_tap(void (*listener)(const double_tap_t*));
const double_tap_t * get_double_tap()
returns an array of the ongoing double_touch data for each finger
Definition: double.c:186
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...
Definition: double.c:30
void init_double_tap()
initializes the data array by setting all field to 0/NULL
Definition: double.c:11
struct double_tap double_tap_t
holds the state, last location, and timestamp of a double tap instance
int set_on_double_tap(void(*listener)(const double_tap_t *))
Listen to double_tap events.
Definition: double.c:52
enum state state_t
This represents the state of individual gesture recognizers.
holds the state, last location, and timestamp of a double tap instance
Definition: double.h:16
int group
Definition: double.h:19
float x0
Definition: double.h:23
state_t state
Definition: double.h:17
float t0
Definition: double.h:25
float y
Definition: double.h:27
float x
Definition: double.h:26
float y0
Definition: double.h:24
float t
Definition: double.h:28
To use the gesture library, users create touch events and fill in the appropriate fields.
Definition: gesturelib.h:17