jacdac.button
Submodules
Package Contents
Classes
A push-button, which returns to inactive position when not operated anymore. |
- class jacdac.button.ButtonClient(bus: jacdac.bus.Bus, role: str)
Bases:
jacdac.button.client_base.ButtonClientBase
A push-button, which returns to inactive position when not operated anymore. Implements a client for the Button service.
- _was_pressed = False
A push-button, which returns to inactive position when not operated anymore.
- property pressed → bool
Determines if the button is pressed currently.
If the event
down
is observed,pressed
is true; ifup
orhold
are observed,pressed
is false. To initialize, wait for any event or timeout topressed
is true after 750ms (1.5x hold time).
- property was_pressed → bool
Determines if the button was pressed since the last time this function was called. Calling this function resets the state.
- _on_event(pkt: jacdac.packet.JDPacket)