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

Go to the source code of this file.

Functions

void init_tap ()
 Initialize tap data structures. More...
 
void recognize_tap (const touch_event_t *event)
 Recognize tap gesture. More...
 
const tap_tget_tap ()
 Access tap data array of size MAX_TOUCHES. More...
 
int set_on_tap (void(*listener)(const tap_t *))
 Subscribe listener to tap gesture updates. More...
 

Variables

tap_t tap_d [MAX_TOUCHES]
 
void(* on_tap )(const tap_t *)=0
 

Function Documentation

◆ get_tap()

const tap_t* get_tap ( )

Access tap data array of size MAX_TOUCHES.

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

Definition at line 34 of file tap.c.

◆ init_tap()

void init_tap ( )

Initialize tap data structures.

Definition at line 12 of file tap.c.

◆ recognize_tap()

void recognize_tap ( const touch_event_t event)

Recognize tap gesture.

Parameters
eventtouch event to recognize

Definition at line 27 of file tap.c.

◆ set_on_tap()

int set_on_tap ( void(*)(const tap_t *)  listener)

Subscribe listener to tap gesture updates.

Parameters
Listeneraccepts a const tap_t*
Returns
0 if first listener, 1 if replacing existing listener

Definition at line 38 of file tap.c.

Variable Documentation

◆ on_tap

void(* on_tap) (const tap_t *)=0 ( const tap_t )

Definition at line 10 of file tap.c.

◆ tap_d

Definition at line 9 of file tap.c.