jacdac.button.client
Module Contents
Classes
A push-button, which returns to inactive position when not operated anymore. |
- class jacdac.button.client.ButtonClient(bus: jacdac.bus.Bus, role: str)
Bases:
jacdac.button.client_base.ButtonClientBaseA push-button, which returns to inactive position when not operated anymore. Implements a client for the Button service.
- property pressed: bool
Determines if the button is pressed currently.
If the event
downis observed,pressedis true; ifuporholdare observed,pressedis false. To initialize, wait for any event or timeout topressedis 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.
- _was_pressed = False
A push-button, which returns to inactive position when not operated anymore.
- _on_event(pkt: jacdac.packet.JDPacket)