package test; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; public class Main{ public static void main(String args[]) throws AWTException { Robot robot = new Robot(); int keyEvent[] = { KeyEvent.VK_H, KeyEvent.VK_E, KeyEvent.VK_L, KeyEvent.VK_L, KeyEvent.VK_O, }; for(int i = 0; i < keyEvent.length; i++) { robot.keyPress(keyEvent[i]); robot.delay(1000); } } }
C++, Java, Python, PHP, Programming Tips, Linux, Bash Shell Scripting, Security And Tech Stuff
Monday, August 23, 2010
Java Robot Class in Java
This is a quick snap of using Robot class of Java. You can find full article on keyboard and mouse events here.
Subscribe to:
Post Comments (Atom)
how is the output?
ReplyDelete