How to send keyboard outputs

java, keyboard

Solution

Everything you need is in `java.awt.Robot`

Example:

Robot robot = new Robot(); 
robot.keyPress(KeyEvent.VK_A); 

Problem

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.

Original source