X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/9d61af1c25aa8a4e2236f196b6f64409e0984eb4..d9e313c16bbe3c441bc2815e3a90a5324b68b92a:/src/keypad.py diff --git a/src/keypad.py b/src/keypad.py index 893ed4e..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 =========================================================== @@ -6,11 +9,6 @@ See `CircuitPython:keypad` in CircuitPython for more details. * Author(s): Melissa LeBlanc-Williams """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import time import threading from collections import deque @@ -69,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. """ @@ -157,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() @@ -389,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