-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HID devices not ready when main.py starts #13
Comments
Per @dhalbert 's request, here was the failing code.
|
dhalbert
added a commit
to dhalbert/Adafruit_CircuitPython_HID
that referenced
this issue
Apr 6, 2018
Try a simple operation in each constructor. If it fails, wait one second and try again (once). Fixes adafruit#13. 2. Don't limit mouse movements to [-127, 127]. Use multiple reports to move further if necessary. I believe this was suggested by Mike Barela (@TheKitty).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On some hosts (reported on a Windows 10 machine),
main.py
can start before the HID devices are ready on the host side. Examples:https://forums.adafruit.com/viewtopic.php?f=52&t=125560#p629406
https://forums.adafruit.com/viewtopic.php?f=52&t=130143
Also reported in Discord (thanks @PhunkMaster)
I added
time.sleep(1)
to some of the HID examples (e.g., https://learn.adafruit.com/adafruit-circuit-playground-express?view=all#circuitpython-hid-keyboard), but this should really be handled in the library or possibly in the native implementation. The creation operations likeMouse()
andKeyboard()
could sleep and retry after failure, possibly just once.The text was updated successfully, but these errors were encountered: