Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Robot keyPress issue

840147Feb 16 2011 — edited Feb 18 2011
Hello all,

I'm trying to send keystrokes (like a Virtual keyboard) from my Java code but I encounter some issues .. it works perfectly on normal applications (for example .. Notepad, browsers etc) but not on games (fullscreen or windowed mode).

This is the stripped code I'm using :
import java.awt.Robot;
import java.awt.AWTException;
import java.awt.event.InputEvent;

Robot robot;

robot.keyPress(KeyEvent.VK_A);
robot.keyRelease(KeyEvent.VK_A);
Can you please help?

Thank you

Sorin

Edited by: 837144 on Feb 16, 2011 1:00 AM - adding CODE tags
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2011
Added on Feb 16 2011
6 comments
549 views