Answer the question
In order to leave comments, you need to log in
How to print Russian character using Java?
Hello. Recently, I finally figured out how to enter text automatically through Robot .
The problem is this:
latin characters are entered wonderfully through the robot.keyPress() method , into which we pass the character code, defining it with getExtendedKeyCodeForChar . However, if we pass a Russian character there, we will get an exception :
java.lang.IllegalArgumentException: Invalid key code
Answer the question
In order to leave comments, you need to log in
You need to change the layout =)
robot.keyPress(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_SHIFT);
robot.delay(1); // required
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_SHIFT);
then make a table of correspondence between the buttons of the Russian and English keyboards
followed by the English code of the desired button.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question