File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ def __init__(self, devices: Sequence[usb_hid.Device]) -> None:
62
62
# View onto bytes 2-7 in report.
63
63
self .report_keys = memoryview (self .report )[2 :]
64
64
65
+ # No keyboard LEDs on.
66
+ self ._led_status = b"\x00 "
67
+
65
68
# Do a no-op to test if HID device is ready.
66
69
# If not, wait a bit and try once more.
67
70
try :
@@ -178,7 +181,10 @@ def _remove_keycode_from_report(self, keycode: int) -> None:
178
181
def led_status (self ) -> bytes :
179
182
"""Returns the last received report"""
180
183
# get_last_received_report() returns None when nothing was received
181
- return self ._keyboard_device .get_last_received_report () or b"\x00 "
184
+ led_report = self ._keyboard_device .get_last_received_report ()
185
+ if led_report is not None :
186
+ self ._led_status = led_report
187
+ return self ._led_status
182
188
183
189
def led_on (self , led_code : int ) -> bool :
184
190
"""Returns whether an LED is on based on the led code
You can’t perform that action at this time.
0 commit comments