Arduino
Arduino copied to clipboard
Library reference pages may list incompatible boards in the compatibility list
https://www.arduino.cc/reference/en/libraries/keyboard/
Arduino Uno/Mega/Nano are included in the compatibility list even though they are not compatible with the Keyboard library.
Additional context
Additional reports
- https://github.com/arduino-libraries/ArduinoIoTCloud/pull/380#issuecomment-1737244158
- https://forum.arduino.cc/t/arduino-keyboard-not-working-on-arduino-uno-r3/1102400
- https://forum.arduino.cc/t/documentation-for-keyboard-library-needs-some-correction/1126221
- https://forum.arduino.cc/t/sketch-funktioniert-nicht-keyboard/1099364/6
- https://forum.arduino.cc/t/issue-on-keyboard-library/1065385
- https://forum.arduino.cc/t/what-is-wrong-here/1080550/7
I suspect this list is autogenerated from the "architecture = avr" or so in the library.properties. I don't think libraries can explicitly state compatibility with some boars, but not others, so this should probably be fixed in the description instead (and looking at that page, the "compatibility note" even already does that, though it might be a bit more specific maybe).
Hi @sterretjeToo.
@matthijskooijman already answered while I was writing, but I'll post anyway in case there is a little bit of additional information:
The library reference pages like https://www.arduino.cc/reference/en/libraries/keyboard/ are automatically generated for all the libraries in the Arduino Library Manager based on the information in their library.properties
metadata file.
The "Compatibility" list on the reference pages is based on the architectures
field of that file. The reference page generator simply adds all the official boards of each architecture in the field to the list.
As in this case, a library might require capabilities that are not provided by all boards of that architecture. There is no machine readable data that would allow the generator to understand this so boards that are incompatible with the library may be listed in the reference page.
There has been some internal discussion about how the library metadata system might be expanded to indicate board compatibility, but for now we settled on warning the reader about the situation via the "Compatibility note" on the reference page:
Compatibility Note
Note: while the library is supposed to compile correctly on these architectures, it might require specific hardware features that may be available only on some boards.
Unfortunately that note does not reveal anything to the beginner that consults the page. Please explain how somebody is to know what that specific hardware is?