Gesture Library
hold_and_drag.h File Reference
#include "drag.h"
#include "gesturelib.h"
#include "recognizer.h"

Go to the source code of this file.

Data Structures

struct  hold_and_drag
 Data structure for hold and drag data. More...
 

Typedefs

typedef struct hold_and_drag hold_and_drag_t
 Data structure for hold and drag data. More...
 

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...
 

Typedef Documentation

◆ hold_and_drag_t

Data structure for hold and drag data.

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.