In CPy HID examples, add a time.sleep() before creating the Keyboard().
Otherwise there's a race condition under some circumstances. See for example: https://forums.adafruit.com/viewtopic.php?f=52&t=125560 and https://forums.adafruit.com/viewtopic.php?f=52&t=130143&p=647131#p647135
This commit is contained in:
parent
cdbab4f512
commit
b76e23a798
2 changed files with 4 additions and 0 deletions
|
|
@ -19,6 +19,8 @@ buttonkeys = [Keycode.A, "Hello World!\n"]
|
|||
controlkey = Keycode.SHIFT
|
||||
|
||||
# the keyboard object!
|
||||
# sleep for a bit to avoid a race condition on some systems
|
||||
time.sleep(1)
|
||||
kbd = Keyboard()
|
||||
# we're americans :)
|
||||
layout = KeyboardLayoutUS(kbd)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ buttonkeys = [Keycode.A, Keycode.B, "Hello World!\n"]
|
|||
controlkey = Keycode.SHIFT
|
||||
|
||||
# the keyboard object!
|
||||
# sleep for a bit to avoid a race condition on some systems
|
||||
time.sleep(1)
|
||||
kbd = Keyboard()
|
||||
# we're americans :)
|
||||
layout = KeyboardLayoutUS(kbd)
|
||||
|
|
|
|||
Loading…
Reference in a new issue