Open
Description
Describe the problem
When using version 1.8.0 or higher of the platform, there are problems with HID functionality of the boards:
- Mouse emulation doesn't work at all on Windows machines
- Keyboard emulation doesn't work at all on Windows machines
- Keyboard emulation is incorrect on Linux machines
To reproduce
Equipment
- Any of the boards supported by the platform.
Steps
Keyboard
- Upload the following sketch to one of the platform's boards:
#include <Keyboard.h> void setup() { pinMode(2, INPUT_PULLUP); pinMode(LED_BUILTIN, OUTPUT); Keyboard.begin(); } void loop() { if (digitalRead(2) == LOW) { Keyboard.print("hello"); digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500); } }
- Open any text editor program, and give focus to the editor.
- Connect pin 2 to ground.
🐛 If connected to a Windows machine, no text is typed.
🐛 If connected to a Linux machine, incorrect text is typed. For example:
heloooooooooooohelohelohelooooooooooooheloooooooooooohelheloheloooooooooooohelooooooooooooheloooooooooooohhelooooooooooooheloooooooooooohelooooooooooooheloooooooooooohelheloooooooooooohelohhelohelhhhelhelohhe
Mouse
- Upload the following sketch to one of the platform's boards:
#include <Mouse.h> void setup() { pinMode(2, INPUT_PULLUP); pinMode(LED_BUILTIN, OUTPUT); Mouse.begin(); } void loop() { if (digitalRead(2) == LOW) { Mouse.move(0, 200); digitalWrite(LED_BUILTIN, HIGH); delay(1000); Mouse.move(0, -200); digitalWrite(LED_BUILTIN, LOW); delay(1000); } }
- Connect the board to a Windows machine.
- Connect pin 2 to ground.
🐛 The mouse pointer does not move.
Has no effect on Windows, but seems to work correctly on Linux.
Arduino SAMD Boards (32-bits ARM Cortex-M0+) version
- 1.8.0
- 1.8.1
- 284bc5a
Operating system
- Linux
- Windows
Operating system version
- Raspbian 9.4
- Ubuntu 19.04
- Windows 10 64 bit
Additional context
When compiled with version 1.6.28 or 1.6.21 of the platform, both sketches work as expected on Windows and Linux.
Reproduced using library versions:
- Keyboard@1.0.2
- Mouse@1.0.1
Reproduced with the following boards:
- MKR 1000 WiFi
- MKR Fox 1200
- MKR GSM 1400
Mouse emulation seems to work correctly on a Linux machine.
Additional reports
- Nano33 IoT arduino-libraries/Keyboard#41
- https://forum.arduino.cc/t/kyboard-examples-not-working-for-arduino-nano-33-iot/628340
- https://forum.arduino.cc/t/mouse-h-library-not-working-on-arduino-zero/630350
- https://forum.arduino.cc/t/i-have-a-question-about-my-mkr-zero/847762
- https://forum.arduino.cc/t/nano-33-iot-and-keyboard-library/896789
- https://forum.arduino.cc/t/arduino-zero-is-buying-it-a-mistake/957425 / Arduino Zero USB HID Broken and unusable Programing Port #663
- https://forum.arduino.cc/t/arduino-zero-joystick-arduino-zero-hid-arduino-zero-usb/1310474/14
Related
Metadata
Metadata
Assignees
Labels
No labels