What can I import to simulate a keyboard press in java?
So for example I can use it to make a programme to automatically press the "a" key when an event occurs.
Everything you need is in java.awt.Robot
java.awt.Robot
Example:
Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_A);
2.1m questions
2.1m answers
60 comments
57.0k users