NinjaFlight
|
#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) |
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.
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.