X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/a734c8e5126f5e9eb1a1d56194fb5aabde700672..c09eb24b13f6f2253a45938735d7b64c6dd3aaa4:/src/keypad.py diff --git a/src/keypad.py b/src/keypad.py index a156d6e..f5f307e 100644 --- a/src/keypad.py +++ b/src/keypad.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT """ `keypad` - Support for scanning keys and key matrices =========================================================== @@ -64,11 +67,11 @@ class Event: ) -class _EventQueue: +class EventQueue: """ A queue of `Event` objects, filled by a `keypad` scanner such as `Keys` or `KeyMatrix`. - You cannot create an instance of `_EventQueue` directly. Each scanner creates an + You cannot create an instance of `EventQueue` directly. Each scanner creates an instance when it is created. """ @@ -152,7 +155,7 @@ class _KeysBase: def __init__(self, interval, max_events, scanning_function): self._interval = interval self._last_scan = time.monotonic() - self._events = _EventQueue(max_events) + self._events = EventQueue(max_events) self._scanning_function = scanning_function self._scan_thread = threading.Thread(target=self._scanning_loop, daemon=True) self._scan_thread.start() @@ -384,7 +387,7 @@ class ShiftRegisterKeys(_KeysBase): key_count, value_when_pressed, interval=0.02, - max_events=64 + max_events=64, ): """ Create a `Keys` object that will scan keys attached to a parallel-in serial-out