Library for Arduino ATmega32U4 USB HID keyboard emulation for any language

This library allows an Arduino board with USB functions to act as a keyboard.
The following languages are integrated: English, German, Russian, French, Greek, Hebrew, Italian, Georgian

This library works like this: you connect a language file and from the moment you can send texts in this language to the computer via HID keyboard emulation.
The language file contains all utf-8 characters of the respective language. The position of the characters corresponds to the HID scancode of the keys.
Your text is decomposed into individual characters and for each character the scan code is found in the language file, after which the scan code is sent to the computer.

The language file can be generated automatically. So almost every language can be recorded.



Switch between selected language and English

Keyboard.language(Russian); // choose russian

Keyboard.println("Я могу есть стекло, оно мне не вредит."); // Write text in Cyrillic

Keyboard.language(); // default - English

// Here, please switch the input language of the operating system

Keyboard.println("I can eat glass and it doesn't hurt me."); // Write text in English

Switching between several languages

#include "KeyboardMappingGE.h"

#include "KeyboardMappingRU.h"


Keyboard.language(German);

Keyboard.println("abc öÖäÄüÜ ß");

Keyboard.language(Russian);

// Here, please switch the input language of the operating system

Keyboard.println("Я могу есть стекло, оно мне не вредит.");

Keyboard.language(); // default - English

// Here, please switch the input language of the operating system

Keyboard.println("I can eat glass and it doesn't hurt me.");



Switch input language of the operating system goes with Windows so:
GUI + space bar

Keyboard.press(KEY_LEFT_GUI);

delay(100);

Keyboard.press(" "); // space bar

delay(100);

Keyboard.releaseAll();

Generate the language file for your language


To generate a language file, load the sketch into the Arduino.
This sketch successively creates the cup prints of all buttons successively. Then all keys are printed sequentially with SHIFT modifier, then with printed Ctrl + Alt (Alt Gr) modifier.

Please open the template in Notepad. Switch on the desired input language in Windows. Place the cursor between two parentheses in the template for the language file. Plug the USB cable from the Arduino into the computer. Now all possible characters are output at the cursor position. Then save the file. Do not forget to change the variables name of the language.




Arduino USB Macro Keyboard aus Touchscreen Panel DIY

Nach oben