NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rc_event_listener Struct Reference

#include <rc.h>

Data Fields

void(* on_key_state )(struct rc_event_listener *self, rc_key_t key, rc_key_state_t newstate)
 
void(* on_key_repeat )(struct rc_event_listener *self, rc_key_t key, rc_key_state_t newstate)
 

Detailed Description

This event listener should be embedded in another struct and you can then use container_of() macro to retreive pointer to your enclosing struct in the event handler. Callbacks can be set to NULL if user does not wish to use them.

Field Documentation

void(* rc_event_listener::on_key_repeat)(struct rc_event_listener *self, rc_key_t key, rc_key_state_t newstate)

This callback is called when a stick combination (or a key) is held in PRESSED state for a duration of RC_KEY_REPEAT_MS. It is not called for range keys that are always held down.

void(* rc_event_listener::on_key_state)(struct rc_event_listener *self, rc_key_t key, rc_key_state_t newstate)

This callback is called when key changes state.


The documentation for this struct was generated from the following file: