There are multiple ways to get the input state.
Showing general usage.
Using registered callback functions.
Using inheritance, by defining a subclass and override the methods pressed(), released() and pressedDuration(unsigned long duration).
Apache License 2.0
-- Mario