From 948c6c568a92dcc39d28160412a7d03c90eb5e61 Mon Sep 17 00:00:00 2001 From: Edgar Bonet Date: Sat, 6 Nov 2021 14:31:17 +0100 Subject: [PATCH 1/2] Document the layout parameter to Keyboard.begin() --- .../Functions/USB/Keyboard/keyboardBegin.adoc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Language/Functions/USB/Keyboard/keyboardBegin.adoc b/Language/Functions/USB/Keyboard/keyboardBegin.adoc index 1a36f3f90..f2b01694b 100644 --- a/Language/Functions/USB/Keyboard/keyboardBegin.adoc +++ b/Language/Functions/USB/Keyboard/keyboardBegin.adoc @@ -20,12 +20,26 @@ When used with a Leonardo or Due board, `Keyboard.begin()` starts emulating a ke [float] === Syntax -`Keyboard.begin()` +`Keyboard.begin()` + +`Keyboard.begin(layout)` [float] === Parameters -None +`layout`: the keyboard layout to use. This parameter is optional and defaults to `KeyboardLayout_en_US`. + + +[float] +=== Keyboard layouts +Currently, the library supports the following national keyboard layouts: + +* `KeyboardLayout_de_DE`: Germany +* `KeyboardLayout_en_US`: USA +* `KeyboardLayout_es_ES`: Spain +* `KeyboardLayout_fr_FR`: France +* `KeyboardLayout_it_IT`: Italy + +Custom layouts can be created by copying and modifying an existing layout. See the instructions in the file KeyboardLayout.h. [float] From 3a87ec432461b36d5d807fb4fd1e14ab77efdac7 Mon Sep 17 00:00:00 2001 From: Edgar Bonet Date: Sun, 21 Nov 2021 15:28:46 +0100 Subject: [PATCH 2/2] keyboardBegin.adoc: Add Notes and Warnings Move the note on custom layouts to this new section, and be more specific on the location of the KeyboardLayout.h file. As per per1234's suggestions. --- Language/Functions/USB/Keyboard/keyboardBegin.adoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Language/Functions/USB/Keyboard/keyboardBegin.adoc b/Language/Functions/USB/Keyboard/keyboardBegin.adoc index f2b01694b..2c27dbf0f 100644 --- a/Language/Functions/USB/Keyboard/keyboardBegin.adoc +++ b/Language/Functions/USB/Keyboard/keyboardBegin.adoc @@ -39,8 +39,6 @@ Currently, the library supports the following national keyboard layouts: * `KeyboardLayout_fr_FR`: France * `KeyboardLayout_it_IT`: Italy -Custom layouts can be created by copying and modifying an existing layout. See the instructions in the file KeyboardLayout.h. - [float] === Returns @@ -82,5 +80,10 @@ void loop() { } ---- + +[float] +=== Notes and Warnings +Custom layouts can be created by copying and modifying an existing layout. See the instructions in the Keyboard library's KeyboardLayout.h file. + -- // HOW TO USE SECTION ENDS