IoAbstraction
Public Member Functions | List of all members
SwitchListener Class Referenceabstract

#include <SwitchInput.h>

Inheritance diagram for SwitchListener:
EncoderUpDownButtons

Public Member Functions

virtual void onPressed (pinid_t pin, bool held)=0
 
virtual void onReleased (pinid_t pin, bool held)=0
 

Detailed Description

Used to register a class that has an interest in the state of a switch. Implement the two virtual functions that will be called back instead of the KeyCallbackFn callback function. This is generally passed addSwitch(...) and the onPressed / onReleased methods are called upon each event.

Member Function Documentation

◆ onPressed()

virtual void SwitchListener::onPressed ( pinid_t  pin,
bool  held 
)
pure virtual

called when a key is pressed or held down

Parameters
pinthe pin number
heldtrue if held down

Implemented in EncoderUpDownButtons.

◆ onReleased()

virtual void SwitchListener::onReleased ( pinid_t  pin,
bool  held 
)
pure virtual

called when a key is released

Parameters
pinthe key number
heldtrue if key was held down

Implemented in EncoderUpDownButtons.


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