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

Go to the source code of this file.

Functions

void init_hold_and_drag ()
 Initialize hold and drag data structures. More...
 
void recognize_hold_and_drag (const touch_event_t *event)
 Recognize hold and drag gesture. More...
 
const hold_and_drag_tget_hold_and_drag ()
 Access hold and drag data array of size MAX_TOUCHES. More...
 
int set_on_hold_and_drag (void(*listener)(const hold_and_drag_t *))
 Subscribe listener to hold and drag gesture updates. More...
 

Variables

hold_and_drag_t hold_and_drag_d [MAX_TOUCHES]
 
void(* on_hold_and_drag )(const hold_and_drag_t *)=0
 

Function Documentation

◆ get_hold_and_drag()

const hold_and_drag_t* get_hold_and_drag ( )

Access hold and drag data array of size MAX_TOUCHES.

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

Definition at line 37 of file hold_and_drag.c.

◆ init_hold_and_drag()

void init_hold_and_drag ( )

Initialize hold and drag data structures.

Definition at line 13 of file hold_and_drag.c.

◆ recognize_hold_and_drag()

void recognize_hold_and_drag ( const touch_event_t event)

Recognize hold and drag gesture.

Parameters
eventtouch event to recognize

Definition at line 28 of file hold_and_drag.c.

◆ set_on_hold_and_drag()

int set_on_hold_and_drag ( void(*)(const hold_and_drag_t *)  listener)

Subscribe listener to hold and drag gesture updates.

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

Definition at line 41 of file hold_and_drag.c.

Variable Documentation

◆ hold_and_drag_d

hold_and_drag_t hold_and_drag_d[MAX_TOUCHES]

Definition at line 10 of file hold_and_drag.c.

◆ on_hold_and_drag

void(* on_hold_and_drag) (const hold_and_drag_t *)=0 ( const hold_and_drag_t )

Definition at line 11 of file hold_and_drag.c.