Skip to content

Sync Keyboard documentation with latest release #881

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

Merged
merged 3 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Language/Functions/USB/Keyboard/keyboardBegin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ When used with a Leonardo or Due board, `Keyboard.begin()` starts emulating a ke
=== Keyboard layouts
Currently, the library supports the following national keyboard layouts:

* `KeyboardLayout_da_DK`: Denmark
* `KeyboardLayout_de_DE`: Germany
* `KeyboardLayout_en_US`: USA
* `KeyboardLayout_es_ES`: Spain
* `KeyboardLayout_fr_FR`: France
* `KeyboardLayout_it_IT`: Italy
* `KeyboardLayout_sv_SE`: Sweden


[float]
Expand Down
58 changes: 58 additions & 0 deletions Language/Functions/USB/Keyboard/keyboardModifiers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ These are all the keys that do not match a printable ASCII character and are not
|KEY_CAPS_LOCK |0xC1 |193
|KEY_BACKSPACE |0xB2 |178
|KEY_RETURN |0xB0 |176
|KEY_MENU |0xED |237
|===

[float]
Expand All @@ -82,6 +83,31 @@ These are all the keys that do not match a printable ASCII character and are not
|KEY_RIGHT_ARROW |0xD7 |215
|===

[float]
==== Numeric keypad

|===
|Key |Hexadecimal value |Decimal value

|KEY_NUM_LOCK |0xDB |219
|KEY_KP_SLASH |0xDC |220
|KEY_KP_ASTERISK |0xDD |221
|KEY_KP_MINUS |0xDE |222
|KEY_KP_PLUS |0xDF |223
|KEY_KP_ENTER |0xE0 |224
|KEY_KP_1 |0xE1 |225
|KEY_KP_2 |0xE2 |226
|KEY_KP_3 |0xE3 |227
|KEY_KP_4 |0xE4 |228
|KEY_KP_5 |0xE5 |229
|KEY_KP_6 |0xE6 |230
|KEY_KP_7 |0xE7 |231
|KEY_KP_8 |0xE8 |232
|KEY_KP_9 |0xE9 |233
|KEY_KP_0 |0xEA |234
|KEY_KP_DOT |0xEB |235
|===

[float]
==== Escape and function keys
The library can simulate function keys up to F24.
Expand Down Expand Up @@ -116,5 +142,37 @@ The library can simulate function keys up to F24.
|KEY_F24 |0xFB |251
|===

[float]
==== Function control keys
These are three keys that sit above the navigation cluster.

|===
|Key |Hexadecimal value |Decimal value |Notes

|KEY_PRINT_SCREEN |0xCE |206 |Print Screen or PrtSc / SysRq
|KEY_SCROLL_LOCK |0xCF |207 |
|KEY_PAUSE |0xD0 |208 |Pause / Break
|===

[float]
==== International keyboard layouts

Some national layouts define extra keys. For example, the Swedish and Danish layouts define `KEY_A_RING` as `0xB7`, which is the key to the right of “P”, labeled “Å” on those layouts and “{”/“[” on the US layout. In order to use those definitions, one has to include the proper Keyboard_*.h file. For example:

[source,arduino]
----
#include <Keyboard.h>
#include <Keyboard_sv_SE.h> // extra key definitions from Swedish layout

void setup() {
Keyboard.begin(KeyboardLayout_sv_SE); // use the Swedish layout
Keyboard.write(KEY_A_RING);
}

void loop() {} // do-nothing loop
----

For the list of layout-specific key definitions, see the respective Keyboard_*.h file within the library sources.

--
// OVERVIEW SECTION ENDS