]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/keypad.py
Check for Python.h file needed for sysv_ipc
[Adafruit_Blinka-hackapet.git] / src / keypad.py
index a156d6e5add4fd0b951ca880d5e33b3618811292..f5f307e76c21a39981d5259a270b1f8dbcba51e1 100644 (file)
@@ -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