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 › stopping ESC from exiting presentation mode
Page Index Toggle Pages: 1
stopping ESC from exiting presentation mode (Read 916 times)
stopping ESC from exiting presentation mode
Oct 19th, 2005, 1:07am
 
really sorry to be asking this... I fear it is ridiculously simple and may have been answered already elsewhere. I want to disable escape key from quitting present mode. the following thread mentions this:

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1114027594;start=3#3

there Fry suggests:
" and if you don't want to let people hit escape (i.e. an installation), you just have to make keyPressed() set key = 0 so that the ESC isn't intercepted."

I have tried

void keyPressed(){
 if(keyCode==ESC || key == ESC){
    key = 0;
    keyCode = 0;
 }
}

but hitting escape still exits present mode.   I need the use of my escape key!  any help would be appreciated!

thanks!

=josh
Re: stopping ESC from exiting presentation mode
Reply #1 - Oct 19th, 2005, 7:51am
 
ah, because it's still picking up the ESC on keyReleased() and keyTyped()

so adding this fixes it:

void keyReleased() {
 if(keyCode==ESC || key == ESC){
    key = 0;
    keyCode = 0;  
 }
}

void keyTyped() {
 if(keyCode==ESC || key == ESC){
    key = 0;
    keyCode = 0;  
 }
}

i've fixed it for 94.
Re: stopping ESC from exiting presentation mode
Reply #2 - Oct 19th, 2005, 6:05pm
 
ahhh fabulous! thanks!

Page Index Toggle Pages: 1