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 › keyCode for Mac "Command" key
Page Index Toggle Pages: 1
keyCode for Mac "Command" key (Read 1071 times)
keyCode for Mac "Command" key
Jun 18th, 2009, 6:47am
 
Does anyone know what the keyCode is for the Mac's Command key.  I tried 91 & 92, which is suppose to be the Windows key Left & Windows key Right.
Re: keyCode for Mac "Command" key
Reply #1 - Jun 18th, 2009, 7:34am
 
I'm not sure, but I would just set up a little test sketch to grab the number. The command key is probably CODED, so run this sketch to see if you can grab the number:

Code:

void setup(){
 size(100,100);
}

void draw(){
}

void keyPressed(){
 if(key == CODED){
   println("coded "+keyCode);
 } else {
   println(key);
 }
}


Hope this helps.  Smiley
Re: keyCode for Mac "Command" key
Reply #2 - Jun 18th, 2009, 7:47am
 
Great idea!  Code 157  Smiley
Page Index Toggle Pages: 1