Tastatureingaben simulieren

Mit Java ist es möglich, virtuell Tastatureingaben auszulösen.

Main.java
package com.rkcsd.apps.desktop.utils.autokeyboard;
 
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.awt.AWTException;
 
public class Main {
 
    public static void main(String[] args) throws AWTException {
        Robot robot = new Robot();
 
        // Typing char 'a'
        robot.keyPress(KeyEvent.VK_A);
        robot.keyRelease(KeyEvent.VK_A);
 
        // Pressing F5 key
        robot.keyPress(KeyEvent.VK_F5);
        robot.keyRelease(KeyEvent.VK_F5);
    }
}