Skip to content

Commit 501721f

Browse files
authored
Merge pull request #22 from dhalbert/keyboard-layout-fix
fix on-demand creation of .keyboard_layout
2 parents 21def3e + 7650b27 commit 501721f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_macropad.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,9 @@ def keyboard_layout(self):
403403
if macropad.encoder_switch:
404404
macropad.keyboard_layout.write("Hello World")
405405
"""
406-
if self._keyboard is None:
407-
self._keyboard = Keyboard(usb_hid.devices)
406+
if self._keyboard_layout is None:
408407
# This will need to be updated if we add more layouts. Currently there is only US.
409-
self._keyboard_layout = KeyboardLayoutUS(self._keyboard)
408+
self._keyboard_layout = KeyboardLayoutUS(self.keyboard)
410409
return self._keyboard_layout
411410

412411
@property

0 commit comments

Comments
 (0)