Multilingual Keyboard library for Arduino
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. |
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.