Repository: arduino-libraries/Keyboard
Branch: master
Commit: 8a97a7a11942
Files: 34
Total size: 75.1 KB
Directory structure:
gitextract_ona_stmt/
├── .codespellrc
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── check-arduino.yml
│ ├── compile-examples.yml
│ ├── report-size-deltas.yml
│ ├── spell-check.yml
│ └── sync-labels.yml
├── LICENSE
├── README.adoc
├── examples/
│ └── Serial/
│ └── Serial.ino
├── keywords.txt
├── library.properties
└── src/
├── Keyboard.cpp
├── Keyboard.h
├── KeyboardLayout.h
├── KeyboardLayout_da_DK.cpp
├── KeyboardLayout_de_DE.cpp
├── KeyboardLayout_en_US.cpp
├── KeyboardLayout_es_ES.cpp
├── KeyboardLayout_fr_FR.cpp
├── KeyboardLayout_hu_HU.cpp
├── KeyboardLayout_it_IT.cpp
├── KeyboardLayout_pt_BR.cpp
├── KeyboardLayout_pt_PT.cpp
├── KeyboardLayout_sv_SE.cpp
├── Keyboard_da_DK.h
├── Keyboard_de_DE.h
├── Keyboard_es_ES.h
├── Keyboard_fr_FR.h
├── Keyboard_hu_HU.h
├── Keyboard_it_IT.h
├── Keyboard_pt_BR.h
├── Keyboard_pt_PT.h
└── Keyboard_sv_SE.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .codespellrc
================================================
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = ,
check-filenames =
check-hidden =
skip = ./.git
================================================
FILE: .github/dependabot.yml
================================================
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
version: 2
updates:
# Configure check for outdated GitHub Actions actions in workflows.
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
labels:
- "topic: infrastructure"
================================================
FILE: .github/workflows/check-arduino.yml
================================================
name: Check Arduino
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Arduino Lint
uses: arduino/arduino-lint-action@v2
with:
compliance: specification
library-manager: update
# Always use this setting for official repositories. Remove for 3rd party projects.
official: true
project-type: library
================================================
FILE: .github/workflows/compile-examples.yml
================================================
name: Compile Examples
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest
env:
SKETCHES_REPORTS_PATH: sketches-reports
strategy:
fail-fast: false
matrix:
board:
- fqbn: arduino:avr:leonardo
platforms: |
- name: arduino:avr
artifact-name-suffix: arduino-avr-leonardo
- fqbn: arduino:sam:arduino_due_x_dbg
platforms: |
- name: arduino:sam
artifact-name-suffix: arduino-sam-arduino_due_x_dbg
- fqbn: arduino:samd:mkrzero
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrzero
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
# Additional library dependencies can be listed here.
# See: https://github.com/arduino/compile-sketches#libraries
sketch-paths: |
- examples
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v7
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
================================================
FILE: .github/workflows/report-size-deltas.yml
================================================
name: Report Size Deltas
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/report-size-deltas.yml"
schedule:
# Run at the minimum interval allowed by GitHub Actions.
# Note: GitHub Actions periodically has outages which result in workflow failures.
# In this event, the workflows will start passing again once the service recovers.
- cron: "*/5 * * * *"
workflow_dispatch:
repository_dispatch:
jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Comment size deltas reports to PRs
uses: arduino/report-size-deltas@v1
with:
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
sketches-reports-source: ^sketches-report-.+
================================================
FILE: .github/workflows/spell-check.yml
================================================
name: Spell Check
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:
jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Spell check
uses: codespell-project/actions-codespell@master
================================================
FILE: .github/workflows/sync-labels.yml
================================================
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
name: Sync Labels
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
pull_request:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
schedule:
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
- cron: "0 8 * * *"
workflow_dispatch:
repository_dispatch:
env:
CONFIGURATIONS_FOLDER: .github/label-configuration-files
CONFIGURATIONS_ARTIFACT: label-configuration-files
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download JSON schema for labels configuration file
id: download-schema
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
location: ${{ runner.temp }}/label-configuration-schema
- name: Install JSON schema validator
run: |
sudo npm install \
--global \
ajv-cli \
ajv-formats
- name: Validate local labels configuration
run: |
# See: https://github.com/ajv-validator/ajv-cli#readme
ajv validate \
--all-errors \
-c ajv-formats \
-s "${{ steps.download-schema.outputs.file-path }}" \
-d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
download:
needs: check
runs-on: ubuntu-latest
strategy:
matrix:
filename:
# Filenames of the shared configurations to apply to the repository in addition to the local configuration.
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
- universal.yml
steps:
- name: Download
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
- name: Pass configuration files to next job via workflow artifact
uses: actions/upload-artifact@v7
with:
path: |
*.yaml
*.yml
if-no-files-found: error
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
sync:
needs: download
runs-on: ubuntu-latest
steps:
- name: Set environment variables
run: |
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
- name: Determine whether to dry run
id: dry-run
if: >
github.event_name == 'pull_request' ||
(
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
) &&
github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
)
run: |
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
# configuration.
echo "::set-output name=flag::--dry-run"
- name: Checkout repository
uses: actions/checkout@v6
- name: Download configuration files artifact
uses: actions/download-artifact@v8
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
path: ${{ env.CONFIGURATIONS_FOLDER }}
- name: Remove unneeded artifact
uses: geekyeggo/delete-artifact@v6
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
- name: Merge label configuration files
run: |
# Merge all configuration files
shopt -s extglob
cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
- name: Install github-label-sync
run: sudo npm install --global github-label-sync
- name: Sync labels
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# See: https://github.com/Financial-Times/github-label-sync
github-label-sync \
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
${{ steps.dry-run.outputs.flag }} \
${{ github.repository }}
================================================
FILE: LICENSE
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
================================================
FILE: README.adoc
================================================
:repository-owner: arduino-libraries
:repository-name: Keyboard
= {repository-name} Library for Arduino =
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"]
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"]
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"]
This library allows an Arduino board with USB capabilities to act as a keyboard.
For more information about this library please visit us at
https://docs.arduino.cc/language-reference/en/functions/usb/Keyboard/
== License ==
Copyright (c) Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
================================================
FILE: examples/Serial/Serial.ino
================================================
/*
Keyboard test
For the Arduino Leonardo, Micro or Due
Reads a byte from the serial port, sends a keystroke back.
The sent keystroke is one higher than what's received, e.g. if you send a,
you get b, send A you get B, and so forth.
The circuit:
- none
created 21 Oct 2011
modified 27 Mar 2012
by Tom Igoe
This example code is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardSerial
*/
#include "Keyboard.h"
void setup() {
// open the serial port:
Serial.begin(9600);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
// check for incoming serial data:
if (Serial.available() > 0) {
// read incoming serial data:
char inChar = Serial.read();
// Type the next ASCII value from what you received:
Keyboard.write(inChar + 1);
}
}
================================================
FILE: keywords.txt
================================================
#######################################
# Syntax Coloring Map For Keyboard
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
Keyboard KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
begin KEYWORD2
write KEYWORD2
press KEYWORD2
release KEYWORD2
releaseAll KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################
================================================
FILE: library.properties
================================================
name=Keyboard
version=1.0.6
author=Arduino
maintainer=Arduino <info@arduino.cc>
sentence=Allows an Arduino board with USB capabilities to act as a Keyboard.
paragraph=This library plugs on the HID library. It can be used with or without other HID-based libraries (Mouse, Gamepad etc)
category=Device Control
url=https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
architectures=avr, samd, sam, renesas_uno
================================================
FILE: src/Keyboard.cpp
================================================
/*
Keyboard.cpp
Copyright (c) 2015, Arduino LLC
Original code (pre-library): Copyright (c) 2011, Peter Barrett
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "Keyboard.h"
#include "KeyboardLayout.h"
#if defined(_USING_HID)
//================================================================================
//================================================================================
// Keyboard
static const uint8_t _hidReportDescriptor[] PROGMEM = {
// Keyboard
0x05, 0x01, // USAGE_PAGE (Generic Desktop) // 47
0x09, 0x06, // USAGE (Keyboard)
0xa1, 0x01, // COLLECTION (Application)
0x85, 0x02, // REPORT_ID (2)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x95, 0x06, // REPORT_COUNT (6)
0x75, 0x08, // REPORT_SIZE (8)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x73, // LOGICAL_MAXIMUM (115)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x73, // USAGE_MAXIMUM (Keyboard Application)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0xc0, // END_COLLECTION
};
Keyboard_::Keyboard_(void)
{
static HIDSubDescriptor node(_hidReportDescriptor, sizeof(_hidReportDescriptor));
HID().AppendDescriptor(&node);
_asciimap = KeyboardLayout_en_US;
}
void Keyboard_::begin(const uint8_t *layout)
{
_asciimap = layout;
}
void Keyboard_::end(void)
{
}
void Keyboard_::sendReport(KeyReport* keys)
{
HID().SendReport(2,keys,sizeof(KeyReport));
}
uint8_t USBPutChar(uint8_t c);
// press() adds the specified key (printing, non-printing, or modifier)
// to the persistent key report and sends the report. Because of the way
// USB HID works, the host acts like the key remains pressed until we
// call release(), releaseAll(), or otherwise clear the report and resend.
size_t Keyboard_::press(uint8_t k)
{
uint8_t i;
if (k >= 136) { // it's a non-printing key (not a modifier)
k = k - 136;
} else if (k >= 128) { // it's a modifier key
_keyReport.modifiers |= (1<<(k-128));
k = 0;
} else { // it's a printing key
k = pgm_read_byte(_asciimap + k);
if (!k) {
setWriteError();
return 0;
}
if ((k & ALT_GR) == ALT_GR) {
_keyReport.modifiers |= 0x40; // AltGr = right Alt
k &= 0x3F;
} else if ((k & SHIFT) == SHIFT) {
_keyReport.modifiers |= 0x02; // the left shift modifier
k &= 0x7F;
}
if (k == ISO_REPLACEMENT) {
k = ISO_KEY;
}
}
// Add k to the key report only if it's not already present
// and if there is an empty slot.
if (_keyReport.keys[0] != k && _keyReport.keys[1] != k &&
_keyReport.keys[2] != k && _keyReport.keys[3] != k &&
_keyReport.keys[4] != k && _keyReport.keys[5] != k) {
for (i=0; i<6; i++) {
if (_keyReport.keys[i] == 0x00) {
_keyReport.keys[i] = k;
break;
}
}
if (i == 6) {
setWriteError();
return 0;
}
}
sendReport(&_keyReport);
return 1;
}
// release() takes the specified key out of the persistent key report and
// sends the report. This tells the OS the key is no longer pressed and that
// it shouldn't be repeated any more.
size_t Keyboard_::release(uint8_t k)
{
uint8_t i;
if (k >= 136) { // it's a non-printing key (not a modifier)
k = k - 136;
} else if (k >= 128) { // it's a modifier key
_keyReport.modifiers &= ~(1<<(k-128));
k = 0;
} else { // it's a printing key
k = pgm_read_byte(_asciimap + k);
if (!k) {
return 0;
}
if ((k & ALT_GR) == ALT_GR) {
_keyReport.modifiers &= ~(0x40); // AltGr = right Alt
k &= 0x3F;
} else if ((k & SHIFT) == SHIFT) {
_keyReport.modifiers &= ~(0x02); // the left shift modifier
k &= 0x7F;
}
if (k == ISO_REPLACEMENT) {
k = ISO_KEY;
}
}
// Test the key report to see if k is present. Clear it if it exists.
// Check all positions in case the key is present more than once (which it shouldn't be)
for (i=0; i<6; i++) {
if (0 != k && _keyReport.keys[i] == k) {
_keyReport.keys[i] = 0x00;
}
}
sendReport(&_keyReport);
return 1;
}
void Keyboard_::releaseAll(void)
{
_keyReport.keys[0] = 0;
_keyReport.keys[1] = 0;
_keyReport.keys[2] = 0;
_keyReport.keys[3] = 0;
_keyReport.keys[4] = 0;
_keyReport.keys[5] = 0;
_keyReport.modifiers = 0;
sendReport(&_keyReport);
}
size_t Keyboard_::write(uint8_t c)
{
uint8_t p = press(c); // Keydown
release(c); // Keyup
return p; // just return the result of press() since release() almost always returns 1
}
size_t Keyboard_::write(const uint8_t *buffer, size_t size) {
size_t n = 0;
while (size--) {
if (*buffer != '\r') {
if (write(*buffer)) {
n++;
} else {
break;
}
}
buffer++;
}
return n;
}
Keyboard_ Keyboard;
#endif
================================================
FILE: src/Keyboard.h
================================================
/*
Keyboard.h
Copyright (c) 2015, Arduino LLC
Original code (pre-library): Copyright (c) 2011, Peter Barrett
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_h
#define KEYBOARD_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// Modifiers
#define KEY_LEFT_CTRL 0x80
#define KEY_LEFT_SHIFT 0x81
#define KEY_LEFT_ALT 0x82
#define KEY_LEFT_GUI 0x83
#define KEY_RIGHT_CTRL 0x84
#define KEY_RIGHT_SHIFT 0x85
#define KEY_RIGHT_ALT 0x86
#define KEY_RIGHT_GUI 0x87
// Misc keys
#define KEY_UP_ARROW 0xDA
#define KEY_DOWN_ARROW 0xD9
#define KEY_LEFT_ARROW 0xD8
#define KEY_RIGHT_ARROW 0xD7
#define KEY_BACKSPACE 0xB2
#define KEY_TAB 0xB3
#define KEY_RETURN 0xB0
#define KEY_MENU 0xED // "Keyboard Application" in USB standard
#define KEY_ESC 0xB1
#define KEY_INSERT 0xD1
#define KEY_DELETE 0xD4
#define KEY_PAGE_UP 0xD3
#define KEY_PAGE_DOWN 0xD6
#define KEY_HOME 0xD2
#define KEY_END 0xD5
#define KEY_CAPS_LOCK 0xC1
#define KEY_PRINT_SCREEN 0xCE // Print Screen / SysRq
#define KEY_SCROLL_LOCK 0xCF
#define KEY_PAUSE 0xD0 // Pause / Break
// Numeric keypad
#define KEY_NUM_LOCK 0xDB
#define KEY_KP_SLASH 0xDC
#define KEY_KP_ASTERISK 0xDD
#define KEY_KP_MINUS 0xDE
#define KEY_KP_PLUS 0xDF
#define KEY_KP_ENTER 0xE0
#define KEY_KP_1 0xE1
#define KEY_KP_2 0xE2
#define KEY_KP_3 0xE3
#define KEY_KP_4 0xE4
#define KEY_KP_5 0xE5
#define KEY_KP_6 0xE6
#define KEY_KP_7 0xE7
#define KEY_KP_8 0xE8
#define KEY_KP_9 0xE9
#define KEY_KP_0 0xEA
#define KEY_KP_DOT 0xEB
// Function keys
#define KEY_F1 0xC2
#define KEY_F2 0xC3
#define KEY_F3 0xC4
#define KEY_F4 0xC5
#define KEY_F5 0xC6
#define KEY_F6 0xC7
#define KEY_F7 0xC8
#define KEY_F8 0xC9
#define KEY_F9 0xCA
#define KEY_F10 0xCB
#define KEY_F11 0xCC
#define KEY_F12 0xCD
#define KEY_F13 0xF0
#define KEY_F14 0xF1
#define KEY_F15 0xF2
#define KEY_F16 0xF3
#define KEY_F17 0xF4
#define KEY_F18 0xF5
#define KEY_F19 0xF6
#define KEY_F20 0xF7
#define KEY_F21 0xF8
#define KEY_F22 0xF9
#define KEY_F23 0xFA
#define KEY_F24 0xFB
// Supported keyboard layouts
extern const uint8_t KeyboardLayout_de_DE[];
extern const uint8_t KeyboardLayout_en_US[];
extern const uint8_t KeyboardLayout_es_ES[];
extern const uint8_t KeyboardLayout_fr_FR[];
extern const uint8_t KeyboardLayout_it_IT[];
extern const uint8_t KeyboardLayout_pt_BR[];
extern const uint8_t KeyboardLayout_pt_PT[];
extern const uint8_t KeyboardLayout_sv_SE[];
extern const uint8_t KeyboardLayout_da_DK[];
extern const uint8_t KeyboardLayout_hu_HU[];
// Low level key report: up to 6 keys and shift, ctrl etc at once
typedef struct
{
uint8_t modifiers;
uint8_t reserved;
uint8_t keys[6];
} KeyReport;
class Keyboard_ : public Print
{
private:
KeyReport _keyReport;
const uint8_t *_asciimap;
void sendReport(KeyReport* keys);
public:
Keyboard_(void);
void begin(const uint8_t *layout = KeyboardLayout_en_US);
void end(void);
size_t write(uint8_t k);
size_t write(const uint8_t *buffer, size_t size);
size_t press(uint8_t k);
size_t release(uint8_t k);
void releaseAll(void);
};
extern Keyboard_ Keyboard;
#endif
#endif
================================================
FILE: src/KeyboardLayout.h
================================================
/*
KeyboardLayout.h
This file is not part of the public API. It is meant to be included
only in Keyboard.cpp and the keyboard layout files. Layout files map
ASCII character codes to keyboard scan codes (technically, to USB HID
Usage codes), possibly altered by the SHIFT or ALT_GR modifiers.
Non-ASCII characters (anything outside the 7-bit range NUL..DEL) are
not supported.
== Creating your own layout ==
In order to create your own layout file, copy an existing layout that
is similar to yours, then modify it to use the correct keys. The
layout is an array in ASCII order. Each entry contains a scan code,
possibly modified by "|SHIFT" or "|ALT_GR", as in this excerpt from
the Italian layout:
0x35, // bslash
0x30|ALT_GR, // ]
0x2e|SHIFT, // ^
Do not change the control characters (those before scan code 0x2c,
corresponding to space). Do not attempt to grow the table past DEL. Do
not use both SHIFT and ALT_GR on the same character: this is not
supported. Unsupported characters should have 0x00 as scan code.
For a keyboard with an ISO physical layout, use the scan codes below:
+---+---+---+---+---+---+---+---+---+---+---+---+---+-------+
|35 |1e |1f |20 |21 |22 |23 |24 |25 |26 |27 |2d |2e |BackSp |
+---+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----+
| Tab |14 |1a |08 |15 |17 |1c |18 |0c |12 |13 |2f |30 | Ret |
+-----++--++--++--++--++--++--++--++--++--++--++--++--++ |
|CapsL |04 |16 |07 |09 |0a |0b |0d |0e |0f |33 |34 |31 | |
+----+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+----+
|Shi.|32 |1d |1b |06 |19 |05 |11 |10 |36 |37 |38 | Shift |
+----+---++--+-+-+---+---+---+---+---+--++---+---++----+----+
|Ctrl|Win |Alt | |AlGr|Win |Menu|Ctrl|
+----+----+----+------------------------+----+----+----+----+
The ANSI layout is identical except that key 0x31 is above (rather
than next to) Return, and there is not key 0x32.
Give a unique name to the layout array, then declare it in Keyboard.h
with a line of the form:
extern const uint8_t KeyboardLayout_xx_YY[];
== Encoding details ==
All scan codes are less than 0x80, which makes bit 7 available to
signal that a modifier (Shift or AltGr) is needed to generate the
character. With only one exception, keys that are used with modifiers
have scan codes that are less than 0x40. This makes bit 6 available
to signal whether the modifier is Shift or AltGr. The exception is
0x64, the key next next to Left Shift on the ISO layout (and absent
from the ANSI layout). We handle it by replacing its value by 0x32 in
the layout arrays.
*/
#include <Arduino.h>
#define SHIFT 0x80
#define ALT_GR 0xc0
#define ISO_KEY 0x64
#define ISO_REPLACEMENT 0x32
================================================
FILE: src/KeyboardLayout_da_DK.cpp
================================================
/*
* Danish keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_da_DK[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x1f|SHIFT, // "
0x20|SHIFT, // #
0x21|ALT_GR, // $
0x22|SHIFT, // %
0x23|SHIFT, // &
0x31, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x31|SHIFT, // *
0x2d, // +
0x36, // ,
0x38, // -
0x37, // .
0x24|SHIFT, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|SHIFT, // ;
0x32, // <
0x27|SHIFT, // =
0x32|SHIFT, // >
0x2d|SHIFT, // ?
0x1f|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x25|ALT_GR, // [
0x32|ALT_GR, // bslash
0x26|ALT_GR, // ]
0x00, // ^ not supported (requires dead key + space)
0x38|SHIFT, // _
0x00, // ` not supported (requires dead key + space)
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x24|ALT_GR, // {
0x2e|ALT_GR, // |
0x27|ALT_GR, // }
0x00, // ~ not supported (requires dead key + space)
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_de_DE.cpp
================================================
/*
* German keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_de_DE[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x1f|SHIFT, // "
0x31, // #
0x21|SHIFT, // $
0x22|SHIFT, // %
0x23|SHIFT, // &
0x31|SHIFT, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x30|SHIFT, // *
0x30, // +
0x36, // ,
0x38, // -
0x37, // .
0x24|SHIFT, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|SHIFT, // ;
0x32, // <
0x27|SHIFT, // =
0x32|SHIFT, // >
0x2d|SHIFT, // ?
0x14|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1d|SHIFT, // Y
0x1c|SHIFT, // Z
0x25|ALT_GR, // [
0x2d|ALT_GR, // bslash
0x26|ALT_GR, // ]
0x00, // ^ not supported (requires dead key + space)
0x38|SHIFT, // _
0x00, // ` not supported (requires dead key + space)
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1d, // y
0x1c, // z
0x24|ALT_GR, // {
0x32|ALT_GR, // |
0x27|ALT_GR, // }
0x30|ALT_GR, // ~
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_en_US.cpp
================================================
/*
* Standard US keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_en_US[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x34|SHIFT, // "
0x20|SHIFT, // #
0x21|SHIFT, // $
0x22|SHIFT, // %
0x24|SHIFT, // &
0x34, // '
0x26|SHIFT, // (
0x27|SHIFT, // )
0x25|SHIFT, // *
0x2e|SHIFT, // +
0x36, // ,
0x2d, // -
0x37, // .
0x38, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x33|SHIFT, // :
0x33, // ;
0x36|SHIFT, // <
0x2e, // =
0x37|SHIFT, // >
0x38|SHIFT, // ?
0x1f|SHIFT, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x2f, // [
0x31, // bslash
0x30, // ]
0x23|SHIFT, // ^
0x2d|SHIFT, // _
0x35, // `
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x2f|SHIFT, // {
0x31|SHIFT, // |
0x30|SHIFT, // }
0x35|SHIFT, // ~
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_es_ES.cpp
================================================
/*
* Spanish keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_es_ES[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x1f|SHIFT, // "
0x20|ALT_GR, // #
0x21|SHIFT, // $
0x22|SHIFT, // %
0x23|SHIFT, // &
0x2d, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x30|SHIFT, // *
0x30, // +
0x36, // ,
0x38, // -
0x37, // .
0x24|SHIFT, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|SHIFT, // ;
0x32, // <
0x27|SHIFT, // =
0x32|SHIFT, // >
0x2d|SHIFT, // ?
0x1f|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x2f|ALT_GR, // [
0x35|ALT_GR, // bslash
0x30|ALT_GR, // ]
0x00, // ^ not supported (requires dead key + space)
0x38|SHIFT, // _
0x00, // ` not supported (requires dead key + space)
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x34|ALT_GR, // {
0x1e|ALT_GR, // |
0x31|ALT_GR, // }
0x00, // ~ not supported (requires dead key + space)
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_fr_FR.cpp
================================================
/*
* Traditional (not AFNOR) French keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_fr_FR[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x38, // !
0x20, // "
0x20|ALT_GR, // #
0x30, // $
0x34|SHIFT, // %
0x1E, // &
0x21, // '
0x22, // (
0x2d, // )
0x31, // *
0x2e|SHIFT, // +
0x10, // ,
0x23, // -
0x36|SHIFT, // .
0x37|SHIFT, // /
0x27|SHIFT, // 0
0x1e|SHIFT, // 1
0x1f|SHIFT, // 2
0x20|SHIFT, // 3
0x21|SHIFT, // 4
0x22|SHIFT, // 5
0x23|SHIFT, // 6
0x24|SHIFT, // 7
0x25|SHIFT, // 8
0x26|SHIFT, // 9
0x37, // :
0x36, // ;
0x32, // <
0x2e, // =
0x32|SHIFT, // >
0x10|SHIFT, // ?
0x27|ALT_GR, // @
0x14|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x33|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x04|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1d|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1a|SHIFT, // Z
0x22|ALT_GR, // [
0x25|ALT_GR, // bslash
0x2d|ALT_GR, // ]
0x26|ALT_GR, // ^
0x25, // _
0x24|ALT_GR, // `
0x14, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x33, // m
0x11, // n
0x12, // o
0x13, // p
0x04, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1d, // w
0x1b, // x
0x1c, // y
0x1a, // z
0x21|ALT_GR, // {
0x23|ALT_GR, // |
0x2e|ALT_GR, // }
0x1f|ALT_GR, // ~
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_hu_HU.cpp
================================================
/*
* Standard HU keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_hu_HU[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x21|SHIFT, // !
0x1f|SHIFT, // "
0x1b|ALT_GR, // #
0x33|ALT_GR, // $
0x22|SHIFT, // %
0x06|ALT_GR, // &
0x1e|SHIFT, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x38|ALT_GR, // *
0x20|SHIFT, // +
0x36, // ,
0x38, // -
0x37, // .
0x23|SHIFT, // /
0x35, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|ALT_GR, // ;
0x32|ALT_GR, // <
0x24|SHIFT, // =
0x1d|ALT_GR, // >
0x36|SHIFT, // ?
0x19|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1d|SHIFT, // Y
0x1c|SHIFT, // Z
0x09|ALT_GR, // [
0x14|ALT_GR, // bslash
0x0a|ALT_GR, // ]
0x20|ALT_GR, // ^
0x38|SHIFT, // _
0x24|ALT_GR, // `
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1d, // y
0x1c, // z
0x05|ALT_GR, // {
0x1a|ALT_GR, // |
0x11|ALT_GR, // }
0x1e|ALT_GR, // ~
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_it_IT.cpp
================================================
/*
* Italian keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_it_IT[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x1f|SHIFT, // "
0x34|ALT_GR, // #
0x21|SHIFT, // $
0x22|SHIFT, // %
0x23|SHIFT, // &
0x2d, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x30|SHIFT, // *
0x30, // +
0x36, // ,
0x38, // -
0x37, // .
0x24|SHIFT, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|SHIFT, // ;
0x32, // <
0x27|SHIFT, // =
0x32|SHIFT, // >
0x2d|SHIFT, // ?
0x33|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x2f|ALT_GR, // [
0x35, // bslash
0x30|ALT_GR, // ]
0x2e|SHIFT, // ^
0x38|SHIFT, // _
0x00, // ` not in this layout
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x00, // { not supported (requires AltGr+Shift)
0x35|SHIFT, // |
0x00, // } not supported (requires AltGr+Shift)
0x00, // ~ not in this layout
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_pt_BR.cpp
================================================
/*
* Brazilian Portuguese keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_pt_BR[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x35|SHIFT, // "
0x20|SHIFT, // #
0x21|SHIFT, // $
0x22|SHIFT, // %
0x24|SHIFT, // &
0x35, // '
0x26|SHIFT, // (
0x27|SHIFT, // )
0x25|SHIFT, // *
0x2E|SHIFT, // +
0x36, // ,
0x2D, // -
0x37, // .
0x14|ALT_GR, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x38|SHIFT, // :
0x38, // ;
0x36|SHIFT, // <
0x2e, // =
0x37|SHIFT, // >
0x1a|ALT_GR, // ?
0x1f|SHIFT, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x30, // [
0x32, // bslash
0x31, // ]
0x00, // ^ not supported (requires dead key + space)
0x2d|SHIFT, // _
0x00, // ` not supported (requires dead key + space)
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x30|SHIFT, // {
0x32|SHIFT, // |
0x31|SHIFT, // }
0x00, // ~ not supported (requires dead key + space)
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_pt_PT.cpp
================================================
/*
* Portuguese keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_pt_PT[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x1f|SHIFT, // "
0x20|SHIFT, // #
0x21|SHIFT, // $
0x22|SHIFT, // %
0x23|SHIFT, // &
0x2d, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x2f|SHIFT, // *
0x2f, // +
0x36, // ,
0x38, // -
0x37, // .
0x24|SHIFT, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|SHIFT, // ;
0x32, // <
0x27|SHIFT, // =
0x32|SHIFT, // >
0x2d|SHIFT, // ?
0x1f|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x25|ALT_GR, // [
0x35, // bslash
0x26|ALT_GR, // ]
0x00, // ^ not supported (requires dead key + space)
0x38|SHIFT, // _
0x00, // ` not supported (requires dead key + space)
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x24|ALT_GR, // {
0x35|SHIFT, // |
0x27|ALT_GR, // }
0x00, // ~ not supported (requires dead key + space)
0x00 // DEL
};
================================================
FILE: src/KeyboardLayout_sv_SE.cpp
================================================
/*
* Swedish keyboard layout.
*/
#include "KeyboardLayout.h"
extern const uint8_t KeyboardLayout_sv_SE[128] PROGMEM =
{
0x00, // NUL
0x00, // SOH
0x00, // STX
0x00, // ETX
0x00, // EOT
0x00, // ENQ
0x00, // ACK
0x00, // BEL
0x2a, // BS Backspace
0x2b, // TAB Tab
0x28, // LF Enter
0x00, // VT
0x00, // FF
0x00, // CR
0x00, // SO
0x00, // SI
0x00, // DEL
0x00, // DC1
0x00, // DC2
0x00, // DC3
0x00, // DC4
0x00, // NAK
0x00, // SYN
0x00, // ETB
0x00, // CAN
0x00, // EM
0x00, // SUB
0x00, // ESC
0x00, // FS
0x00, // GS
0x00, // RS
0x00, // US
0x2c, // ' '
0x1e|SHIFT, // !
0x1f|SHIFT, // "
0x20|SHIFT, // #
0x21|ALT_GR, // $
0x22|SHIFT, // %
0x23|SHIFT, // &
0x31, // '
0x25|SHIFT, // (
0x26|SHIFT, // )
0x31|SHIFT, // *
0x2d, // +
0x36, // ,
0x38, // -
0x37, // .
0x24|SHIFT, // /
0x27, // 0
0x1e, // 1
0x1f, // 2
0x20, // 3
0x21, // 4
0x22, // 5
0x23, // 6
0x24, // 7
0x25, // 8
0x26, // 9
0x37|SHIFT, // :
0x36|SHIFT, // ;
0x32, // <
0x27|SHIFT, // =
0x32|SHIFT, // >
0x2d|SHIFT, // ?
0x1f|ALT_GR, // @
0x04|SHIFT, // A
0x05|SHIFT, // B
0x06|SHIFT, // C
0x07|SHIFT, // D
0x08|SHIFT, // E
0x09|SHIFT, // F
0x0a|SHIFT, // G
0x0b|SHIFT, // H
0x0c|SHIFT, // I
0x0d|SHIFT, // J
0x0e|SHIFT, // K
0x0f|SHIFT, // L
0x10|SHIFT, // M
0x11|SHIFT, // N
0x12|SHIFT, // O
0x13|SHIFT, // P
0x14|SHIFT, // Q
0x15|SHIFT, // R
0x16|SHIFT, // S
0x17|SHIFT, // T
0x18|SHIFT, // U
0x19|SHIFT, // V
0x1a|SHIFT, // W
0x1b|SHIFT, // X
0x1c|SHIFT, // Y
0x1d|SHIFT, // Z
0x25|ALT_GR, // [
0x2d|ALT_GR, // bslash
0x26|ALT_GR, // ]
0x00, // ^ not supported (requires dead key + space)
0x38|SHIFT, // _
0x00, // ` not supported (requires dead key + space)
0x04, // a
0x05, // b
0x06, // c
0x07, // d
0x08, // e
0x09, // f
0x0a, // g
0x0b, // h
0x0c, // i
0x0d, // j
0x0e, // k
0x0f, // l
0x10, // m
0x11, // n
0x12, // o
0x13, // p
0x14, // q
0x15, // r
0x16, // s
0x17, // t
0x18, // u
0x19, // v
0x1a, // w
0x1b, // x
0x1c, // y
0x1d, // z
0x24|ALT_GR, // {
0x32|ALT_GR, // |
0x27|ALT_GR, // }
0x00, // ~ not supported (requires dead key + space)
0x00 // DEL
};
================================================
FILE: src/Keyboard_da_DK.h
================================================
/*
Keyboard_da_DK.h
Copyright (c) 2021, Peter John
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_DA_DK_h
#define KEYBOARD_DA_DK_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// DA_DK keys
#define KEY_A_RING (136+0x2f)
#define KEY_SLASHED_O (136+0x34)
#define KEY_ASH (136+0x33)
#define KEY_UMLAUT (136+0x30)
#define KEY_ACUTE_ACC (136+0x2e)
#endif
#endif
================================================
FILE: src/Keyboard_de_DE.h
================================================
/*
Keyboard_de_DE.h
Copyright (c) 2022, Edgar Bonet
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_DE_DE_h
#define KEYBOARD_DE_DE_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// de_DE keys
#define KEY_CIRCUMFLEX (136+0x35)
#define KEY_ESZETT (136+0x2d)
#define KEY_ACUTE (136+0x2e)
#define KEY_U_UMLAUT (136+0x2f)
#define KEY_O_UMLAUT (136+0x33)
#define KEY_A_UMLAUT (136+0x34)
#endif
#endif
================================================
FILE: src/Keyboard_es_ES.h
================================================
/*
Keyboard_es_ES.h
Copyright (c) 2022, Edgar Bonet
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_ES_ES_h
#define KEYBOARD_ES_ES_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// es_ES keys
#define KEY_MASCULINE_ORDINAL (136+0x35)
#define KEY_INVERTED_EXCLAMATION (136+0x2e)
#define KEY_GRAVE (136+0x2f)
#define KEY_N_TILDE (136+0x33)
#define KEY_ACUTE (136+0x34)
#define KEY_C_CEDILLA (136+0x31)
#endif
#endif
================================================
FILE: src/Keyboard_fr_FR.h
================================================
/*
Keyboard_fr_FR.h
Copyright (c) 2022, Edgar Bonet
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_FR_FR_h
#define KEYBOARD_FR_FR_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// fr_FR keys
#define KEY_SUPERSCRIPT_TWO (136+0x35)
#define KEY_E_ACUTE (136+0x1f)
#define KEY_E_GRAVE (136+0x24)
#define KEY_C_CEDILLA (136+0x26)
#define KEY_A_GRAVE (136+0x27)
#define KEY_CIRCUMFLEX (136+0x2f)
#define KEY_U_GRAVE (136+0x34)
#endif
#endif
================================================
FILE: src/Keyboard_hu_HU.h
================================================
/*
Keyboard_hu_HU.h
Copyright (c) 2023, Barab(0x34)si Rich(0x34)rd
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_HU_HU_h
#define KEYBOARD_HU_HU_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// hu_HU keys
#define KEY_O_ACUTE (136+0x2e)
#define KEY_O_UMLAUT (136+0x27)
#define KEY_O_DOUBLE_ACUTE (136+0x2f)
#define KEY_U_ACUTE (136+0x30)
#define KEY_U_UMLAUT (136+0x2d)
#define KEY_U_DOUBLE_ACUTE (136+0x31)
#define KEY_A_ACUTE (136+0x34)
#define KEY_E_ACUTE (136+0x33)
#define KEY_I_ACUTE (136+0x32)
#endif
#endif
================================================
FILE: src/Keyboard_it_IT.h
================================================
/*
Keyboard_it_IT.h
Copyright (c) 2022, Edgar Bonet
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_IT_IT_h
#define KEYBOARD_IT_IT_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// it_IT keys
#define KEY_I_GRAVE (136+0x2e)
#define KEY_E_GRAVE (136+0x2f)
#define KEY_O_GRAVE (136+0x33)
#define KEY_A_GRAVE (136+0x34)
#define KEY_U_GRAVE (136+0x31)
#endif
#endif
================================================
FILE: src/Keyboard_pt_BR.h
================================================
/*
Keyboard_pt_BR.h
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_PT_BR_h
#define KEYBOARD_PT_BR_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// pt_BR keys
#define KEY_ACUTE (136+0x2f)
#define KEY_C_CEDILLA (136+0x33)
#define KEY_TILDE (136+0x34)
#endif
#endif
================================================
FILE: src/Keyboard_pt_PT.h
================================================
/*
Keyboard_pt_PT.h
Copyright (c) 2022, Edgar Bonet
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_PT_PT_h
#define KEYBOARD_PT_PT_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// pt_PT keys
#define KEY_LEFT_GUILLEMET (136+0x2e)
#define KEY_ACUTE (136+0x30)
#define KEY_C_CEDILLA (136+0x33)
#define KEY_MASCULINE_ORDINAL (136+0x34)
#define KEY_TILDE (136+0x31)
#endif
#endif
================================================
FILE: src/Keyboard_sv_SE.h
================================================
/*
Keyboard_sv_SE.h
Copyright (c) 2021, Peter John
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KEYBOARD_SV_SE_h
#define KEYBOARD_SV_SE_h
#include "HID.h"
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#else
//================================================================================
//================================================================================
// Keyboard
// SV_SE keys
#define KEY_A_RING (136+0x2f)
#define KEY_A_UMLAUT (136+0x34)
#define KEY_O_UMLAUT (136+0x33)
#define KEY_UMLAUT (136+0x30)
#define KEY_ACUTE_ACC (136+0x2e)
#endif
#endif
gitextract_ona_stmt/
├── .codespellrc
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── check-arduino.yml
│ ├── compile-examples.yml
│ ├── report-size-deltas.yml
│ ├── spell-check.yml
│ └── sync-labels.yml
├── LICENSE
├── README.adoc
├── examples/
│ └── Serial/
│ └── Serial.ino
├── keywords.txt
├── library.properties
└── src/
├── Keyboard.cpp
├── Keyboard.h
├── KeyboardLayout.h
├── KeyboardLayout_da_DK.cpp
├── KeyboardLayout_de_DE.cpp
├── KeyboardLayout_en_US.cpp
├── KeyboardLayout_es_ES.cpp
├── KeyboardLayout_fr_FR.cpp
├── KeyboardLayout_hu_HU.cpp
├── KeyboardLayout_it_IT.cpp
├── KeyboardLayout_pt_BR.cpp
├── KeyboardLayout_pt_PT.cpp
├── KeyboardLayout_sv_SE.cpp
├── Keyboard_da_DK.h
├── Keyboard_de_DE.h
├── Keyboard_es_ES.h
├── Keyboard_fr_FR.h
├── Keyboard_hu_HU.h
├── Keyboard_it_IT.h
├── Keyboard_pt_BR.h
├── Keyboard_pt_PT.h
└── Keyboard_sv_SE.h
SYMBOL INDEX (2 symbols across 1 files) FILE: src/Keyboard.h type KeyReport (line 126) | typedef struct function class (line 133) | class Keyboard_ : public Print
Condensed preview — 34 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (83K chars).
[
{
"path": ".codespellrc",
"chars": 267,
"preview": "# See: https://github.com/codespell-project/codespell#using-a-config-file\n[codespell]\n# In the event of a false positive"
},
{
"path": ".github/dependabot.yml",
"chars": 547,
"preview": "# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-t"
},
{
"path": ".github/workflows/check-arduino.yml",
"chars": 761,
"preview": "name: Check Arduino\n\n# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workfl"
},
{
"path": ".github/workflows/compile-examples.yml",
"chars": 2212,
"preview": "name: Compile Examples\n\n# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-wor"
},
{
"path": ".github/workflows/report-size-deltas.yml",
"chars": 843,
"preview": "name: Report Size Deltas\n\n# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-w"
},
{
"path": ".github/workflows/spell-check.yml",
"chars": 551,
"preview": "name: Spell Check\n\n# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflow"
},
{
"path": ".github/workflows/sync-labels.yml",
"chars": 4676,
"preview": "# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md\nname: Sync Label"
},
{
"path": "LICENSE",
"chars": 7652,
"preview": " GNU LESSER GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007"
},
{
"path": "README.adoc",
"chars": 1780,
"preview": ":repository-owner: arduino-libraries\n:repository-name: Keyboard\n\n= {repository-name} Library for Arduino =\n\nimage:https:"
},
{
"path": "examples/Serial/Serial.ino",
"chars": 847,
"preview": "/*\n Keyboard test\n\n For the Arduino Leonardo, Micro or Due\n\n Reads a byte from the serial port, sends a keystroke bac"
},
{
"path": "keywords.txt",
"chars": 542,
"preview": "#######################################\n# Syntax Coloring Map For Keyboard\n#######################################\n\n####"
},
{
"path": "library.properties",
"chars": 423,
"preview": "name=Keyboard\nversion=1.0.6\nauthor=Arduino\nmaintainer=Arduino <info@arduino.cc>\nsentence=Allows an Arduino board with US"
},
{
"path": "src/Keyboard.cpp",
"chars": 6244,
"preview": "/*\n Keyboard.cpp\n\n Copyright (c) 2015, Arduino LLC\n Original code (pre-library): Copyright (c) 2011, Peter Barrett\n\n "
},
{
"path": "src/Keyboard.h",
"chars": 4497,
"preview": "/*\n Keyboard.h\n\n Copyright (c) 2015, Arduino LLC\n Original code (pre-library): Copyright (c) 2011, Peter Barrett\n\n T"
},
{
"path": "src/KeyboardLayout.h",
"chars": 2833,
"preview": "/*\n KeyboardLayout.h\n\n This file is not part of the public API. It is meant to be included\n only in Keyboard.cpp and "
},
{
"path": "src/KeyboardLayout_da_DK.cpp",
"chars": 3027,
"preview": "/*\n * Danish keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_da_DK[128] PROGMEM ="
},
{
"path": "src/KeyboardLayout_de_DE.cpp",
"chars": 2984,
"preview": "/*\n * German keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_de_DE[128] PROGMEM ="
},
{
"path": "src/KeyboardLayout_en_US.cpp",
"chars": 2903,
"preview": "/*\n * Standard US keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_en_US[128] PROG"
},
{
"path": "src/KeyboardLayout_es_ES.cpp",
"chars": 3028,
"preview": "/*\n * Spanish keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_es_ES[128] PROGMEM "
},
{
"path": "src/KeyboardLayout_fr_FR.cpp",
"chars": 2922,
"preview": "/*\n * Traditional (not AFNOR) French keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLay"
},
{
"path": "src/KeyboardLayout_hu_HU.cpp",
"chars": 2909,
"preview": "/*\n * Standard HU keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_hu_HU[128] PROG"
},
{
"path": "src/KeyboardLayout_it_IT.cpp",
"chars": 3015,
"preview": "/*\n * Italian keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_it_IT[128] PROGMEM "
},
{
"path": "src/KeyboardLayout_pt_BR.cpp",
"chars": 3041,
"preview": "/*\n * Brazilian Portuguese keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_pt_BR["
},
{
"path": "src/KeyboardLayout_pt_PT.cpp",
"chars": 3031,
"preview": "/*\n * Portuguese keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_pt_PT[128] PROGM"
},
{
"path": "src/KeyboardLayout_sv_SE.cpp",
"chars": 3029,
"preview": "/*\n * Swedish keyboard layout.\n */\n\n#include \"KeyboardLayout.h\"\n\nextern const uint8_t KeyboardLayout_sv_SE[128] PROGMEM "
},
{
"path": "src/Keyboard_da_DK.h",
"chars": 1329,
"preview": "/*\n Keyboard_da_DK.h\n\n Copyright (c) 2021, Peter John\n\n This library is free software; you can redistribute it and/or"
},
{
"path": "src/Keyboard_de_DE.h",
"chars": 1367,
"preview": "/*\n Keyboard_de_DE.h\n\n Copyright (c) 2022, Edgar Bonet\n\n This library is free software; you can redistribute it and/o"
},
{
"path": "src/Keyboard_es_ES.h",
"chars": 1409,
"preview": "/*\n Keyboard_es_ES.h\n\n Copyright (c) 2022, Edgar Bonet\n\n This library is free software; you can redistribute it and/o"
},
{
"path": "src/Keyboard_fr_FR.h",
"chars": 1418,
"preview": "/*\n Keyboard_fr_FR.h\n\n Copyright (c) 2022, Edgar Bonet\n\n This library is free software; you can redistribute it and/o"
},
{
"path": "src/Keyboard_hu_HU.h",
"chars": 1551,
"preview": "/*\n Keyboard_hu_HU.h\n\n Copyright (c) 2023, Barab(0x34)si Rich(0x34)rd\n\n This library is free software; you can redist"
},
{
"path": "src/Keyboard_it_IT.h",
"chars": 1330,
"preview": "/*\n Keyboard_it_IT.h\n\n Copyright (c) 2022, Edgar Bonet\n\n This library is free software; you can redistribute it and/o"
},
{
"path": "src/Keyboard_pt_BR.h",
"chars": 1242,
"preview": "/*\n Keyboard_pt_BR.h\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of th"
},
{
"path": "src/Keyboard_pt_PT.h",
"chars": 1365,
"preview": "/*\n Keyboard_pt_PT.h\n\n Copyright (c) 2022, Edgar Bonet\n\n This library is free software; you can redistribute it and/o"
},
{
"path": "src/Keyboard_sv_SE.h",
"chars": 1329,
"preview": "/*\n Keyboard_sv_SE.h\n\n Copyright (c) 2021, Peter John\n\n This library is free software; you can redistribute it and/or"
}
]
About this extraction
This page contains the full source code of the arduino-libraries/Keyboard GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 34 files (75.1 KB), approximately 26.0k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.