Y
Y
YariKartoshe4ka2020-06-01 15:09:25
Arduino
YariKartoshe4ka, 2020-06-01 15:09:25

How to type in English text?

I wrote a simple code:

#include <Keyboard.h>

void setup() {
  Keyboard.begin();
}

void loop() {
  Keyboard.write(114);
  delay(10000);
}

But, as I understand it, it should print the character r regardless of the current keyboard layout, but for some reason, on the Russian keyboard it writes to, and on the English keyboard it writes r. How can you achieve the desired result?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
YariKartoshe4ka, 2020-06-04
@YariKartoshe4ka

In general, I didn’t find anything sensible on the Internet, but I came across the idea of ​​ALT codes, which does not depend on the layout. Wrote my little ducky parser using this github idea

K
Konstantin Zaitsev, 2020-06-01
@KonstantineZ

Only the arduino code does not. The code of the pressed key does not depend on the layout, it is the program that determines which letter you pressed. Therefore, you can do this: in the Windows settings, write ctrl + shift - Russian, alt + shift - English. Then if you press ctrl + shift before printing, the language will become Russian and the goal is achieved. On an unprepared computer, I think it's impossible.

K
kalapanga, 2020-06-01
@kalapanga

Have a look at this library: https://github.com/MichaelDworkin/KeyboardMultiLanguage , it might suit your purposes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question