simulate backspace key with java.awt.Robot

Posted by Tyler on Stack Overflow See other posts from Stack Overflow or by Tyler
Published on 2010-04-07T23:42:04Z Indexed on 2010/04/08 0:03 UTC
Read the original article Hit count: 861

There seems to be an issue simulating the backspace key with java.awt.Robot.

This thread seems to confirm this but it does not propose a solution.

This works:

Robot rob = new Robot();
rob.keyPress(KeyEvent.VK_A);
rob.keyRelease(KeyEvent.VK_A);

This doesn't:

Robot rob = new Robot();
rob.keyPress(KeyEvent.VK_BACK_SPACE);
rob.keyRelease(KeyEvent.VK_BACK_SPACE);

Any ideas?

Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about robot