A library to manage multiple keypad instances (and compatible) as a single event queue.
Implementation Notes
Software and Dependencies:
-
class multi_keypad.Event(keypad, event, offset=0)
Event class, adds the keypad ID to the keypad event.
- Parameters:
keypad (int) – The ID number of the keypad that generated that event.
event (obj) – The original keypad event.
offset (int) – The offset added to the key_number (default 0).
-
class multi_keypad.EventMultiQueue(keypads)
A queue of Event objects.
-
clear() → None
Clear any queued key transition events.
Also sets overflowed to False.
-
get() → Event
Return the next key transition event.
Return None if no events are pending.
-
get_into(event: Event) → bool
Puts the next event into the passed object. This does not avoid
allocating storage because we have to cache events from the underlying
keypads anyway. Only there for compatibility.
-
overflowed() → bool
True if an event could not be added to the event queue because
it was full. (read-only) Set to False by clear().
-
class multi_keypad.MultiKeypad(*keypads)
Multi Keypad. Read events from multiple keypads as a single queue.
- Parameters:
keypads (obj) – Instances of keypad scanenrs or compatible objects.
-
next_event()
Deprecated method to get the next event