File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 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:
6262 # View onto bytes 2-7 in report.
6363 self .report_keys = memoryview (self .report )[2 :]
6464
65+ # No keyboard LEDs on.
66+ self ._led_status = b"\x00 "
67+
6568 # Do a no-op to test if HID device is ready.
6669 # If not, wait a bit and try once more.
6770 try :
@@ -178,7 +181,10 @@ def _remove_keycode_from_report(self, keycode: int) -> None:
178181 def led_status (self ) -> bytes :
179182 """Returns the last received report"""
180183 # 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
182188
183189 def led_on (self , led_code : int ) -> bool :
184190 """Returns whether an LED is on based on the led code
You can’t perform that action at this time.
0 commit comments