Gesture Library
tap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gesturelib.h"
4 #include "gestureparams.h"
5 #include "recognizer.h"
6 
8 typedef struct tap {
10 
11  // intial position and time
12  float x0;
13  float y0;
14  float t0;
15 
16  // current position
17  float x;
18  float y;
19  float t;
21 
23 void init_tap();
24 
27 void recognize_tap(const touch_event_t* event);
28 
31 const tap_t* get_tap();
32 
36 int set_on_tap(void (*listener)(const tap_t*));
enum state state_t
This represents the state of individual gesture recognizers.
Data structure for tap data.
Definition: tap.h:8
float x0
Definition: tap.h:12
state_t state
Definition: tap.h:9
float t0
Definition: tap.h:14
float y
Definition: tap.h:18
float x
Definition: tap.h:17
float y0
Definition: tap.h:13
float t
Definition: tap.h:19
To use the gesture library, users create touch events and fill in the appropriate fields.
Definition: gesturelib.h:17
int set_on_tap(void(*listener)(const tap_t *))
Subscribe listener to tap gesture updates.
Definition: tap.c:38
void init_tap()
Initialize tap data structures.
Definition: tap.c:12
struct tap tap_t
Data structure for tap data.
const tap_t * get_tap()
Access tap data array of size MAX_TOUCHES.
Definition: tap.c:34
void recognize_tap(const touch_event_t *event)
Recognize tap gesture.
Definition: tap.c:27