libPocuter  1.0
Support library for programming the Pocuter
PocuterButtons Class Referenceabstract

options to access the Pocuter buttons More...

#include <PocuterButtons.h>

Public Types

enum  PBUTTONS { BUTTON_1 =0x01, BUTTON_2 =0x02, BUTTON_3 =0x04 }
 
typedef void() buttonEventHandler(PBUTTONS, void *)
 

Public Member Functions

virtual void registerEventHandler (buttonEventHandler *e, void *u)=0
 register an event callback More...
 
virtual void unregisterEventHandler ()=0
 unregister the event handler More...
 
virtual PBUTTONS getButtonState ()=0
 get the current state of the buttons More...
 

Detailed Description

options to access the Pocuter buttons

Member Typedef Documentation

◆ buttonEventHandler

typedef void() PocuterButtons::buttonEventHandler(PBUTTONS, void *)

type definition of the event callback function

Member Enumeration Documentation

◆ PBUTTONS

Enumerator
BUTTON_1 

the lower right button

BUTTON_2 

the upper right button

BUTTON_3 

the lower left button

Member Function Documentation

◆ 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()

virtual void PocuterButtons::registerEventHandler ( buttonEventHandler e,
void *  u 
)
pure virtual

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
ea pointer to the callback function
ua 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: