I was try to make automation software that can paste some copied data from clipboard, but get some weird behavior. I use java.awt.Robot
to achieve this. This is the code :
try{
java.awt.Robot robot = new Robot();
robot.setAutoDelay(250);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
}catch(AWTException ex){
ex.printStackTrace();
}
How to trigger native paste event properly on Windows with Java?