options to access the Pocuter buttons
More...
#include <PocuterButtons.h>
options to access the Pocuter buttons
◆ buttonEventHandler
| typedef void() PocuterButtons::buttonEventHandler(PBUTTONS, void *) |
type definition of the event callback function
◆ PBUTTONS
| Enumerator |
|---|
| BUTTON_1 | the lower right button
|
| BUTTON_2 | the upper right button
|
| BUTTON_3 | the lower left button
|
◆ getButtonState()
| virtual PBUTTONS PocuterButtons::getButtonState |
( |
| ) |
|
|
pure virtual |
get the current state of the buttons
- Note
- the return value is a bit matrix with all buttons. so to check if a button was pressed you can do a "if(getButtonState() & PocuterButtons::BUTTON_1) {...}" for example
- Returns
- PBUTTONS
◆ registerEventHandler()
register an event callback
- Note
- the event handler is called every time an button was pressed or released. the PBUTTONS value is a bit matrix with all buttons. so to check if a button was pressed you can do a "if(getButtonState() & PocuterButtons::BUTTON_1) {...}" for example
- Parameters
-
| e | a pointer to the callback function |
| u | a pointer to user data sent to the event handler on each event |
◆ unregisterEventHandler()
| virtual void PocuterButtons::unregisterEventHandler |
( |
| ) |
|
|
pure virtual |
unregister the event handler
The documentation for this class was generated from the following file: