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 › Detecting the "Windows" and "Contex
Page Index Toggle Pages: 1
Detecting the "Windows" and "Contex (Read 357 times)
Detecting the "Windows" and "Contex
Sep 9th, 2006, 9:34pm
 
Has anyone figured out a way to disable or catch the "Windows" or the "Context" key in Processing?

If not, this may be a limitation of Java 1.4, which actually has no keycode for these keys.  However, Java 1.5 introduces two new keycodes for these two keypresses.

check out #4620715 - "New KeyEvent codes for two standard Microsoft Windows keys" at this link for more info.

http://java.sun.com/j2se/1.5.0/docs/guide/awt/1.5/index.html

Re: Detecting the "Windows" and "Co
Reply #1 - Sep 19th, 2006, 5:10pm
 
on macintosh ther is no problem in distinguish between all these specialKeys.. tried out with that one


import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

void setup() {
 addKeyListener(new MyKeyListener());
}

class MyKeyListener implements KeyListener {


 MyKeyListener() {
 }

 void keyTyped(KeyEvent e) {
   println("SHIFT down "+e.isShiftDown());
   println("CONTROL down "+e.isControlDown());
   println("META down "+e.isMetaDown());
   println("ALT down "+e.isAltDown());
 }

 void keyPressed(KeyEvent e) {
 }

 void keyReleased(KeyEvent e) {
   println("KEY down "+e.getKeyCode());
 }

}



but I'm not sure if its any help.
Page Index Toggle Pages: 1