Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
trimbitassorin
trimbitassorin's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Robot keyPress issue
[2 Replies]
15-Feb-2011 02:35 AM
Forum:
Programming Questions
Hello all,
I'm trying to send keystrokes from my Processing 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;
void setup()
{
try
{
robot = new Robot();
}
catch(AWTException a)
{
// Nothing for now :)
}
}
void draw()
{
robot.keyPress(KeyEvent.VK_A);
robot.keyRelease(KeyEvent.VK_A);
delay(1000);
}
Can you please help?
Thank you
Sorin
«Prev
Next »
Moderate user : trimbitassorin
Forum