Gesture Library
hold.c File Reference
#include "hold.h"
#include "math.h"
#include "stroke.h"
#include "utils.h"

Go to the source code of this file.

Functions

void init_hold ()
 Initialize hold data structures. More...
 
void recognize_hold (const touch_event_t *event)
 Recognize hold gesture. More...
 
int set_on_hold (void(*listener)(const hold_t *))
 Listen to hold events. More...
 
const hold_tget_hold ()
 Access hold data array of size MAX_TOUCHES. More...
 

Variables

hold_t hold_d [MAX_TOUCHES]
 
void(* on_hold )(const hold_t *)=0
 

Function Documentation

◆ get_hold()

const hold_t* get_hold ( )

Access hold data array of size MAX_TOUCHES.

Returns
Address of first element of hold data array of size MAX_TOUCHES

Definition at line 44 of file hold.c.

◆ init_hold()

void init_hold ( )

Initialize hold data structures.

Definition at line 12 of file hold.c.

◆ recognize_hold()

void recognize_hold ( const touch_event_t event)

Recognize hold gesture.

Parameters
eventtouch event to recognize

Definition at line 27 of file hold.c.

◆ set_on_hold()

int set_on_hold ( void(*)(const hold_t *)  listener)

Listen to hold events.

Parameters
listeneraccepts a const hold_t*
Returns
0 if first listener, 1 if replacing existing listener

Definition at line 34 of file hold.c.

Variable Documentation

◆ hold_d

Definition at line 9 of file hold.c.

◆ on_hold

void(* on_hold) (const hold_t *)=0 ( const hold_t )

Definition at line 10 of file hold.c.