We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to keep the focus with keyCode==ALT
Page Index Toggle Pages: 1
how to keep the focus with keyCode==ALT (Read 773 times)
how to keep the focus with keyCode==ALT
May 6th, 2005, 10:03am
 
Hi

I'm wondering how should I use the ALT modifier key, if everytime I press it my sketch loses the focus (it goes to the windows task bar I believe); I have to press it again to regain the focus..

Code:

void setup() {}
void draw() {}
void keyPressed() {
println("key was pressed");
if (keyCode==SHIFT) {
println("shift pressed");
}
if (keyCode==ALT) {
println("alt pressed");
}
}


if you try this, the application does not receive the keyPressed event after alt is pressed once... it has to be pressed twice...

any trick or easy workaround for this?


thanks!
Page Index Toggle Pages: 1