Apple key shortcut problem for macintosh.

Hi,

I have added a keyEventDispatcher for various components in my application. In windows or linux it works fine.

In Macintosh I need to implement the similar kind of a code.

InStead of Control key, I need to use Apple key.

also What should i use for alter key?

How should i achieve this? Because there is very little help on the web

for macintosh -java.

if (keyEvent.getKeyCode() == KeyEvent.VK_T &&

((keyEvent.getModifiersEx() & KeyEvent.ALT_DOWN_MASK) != 0) &&

((keyEvent.getModifiersEx() & KeyEvent.SHIFT_DOWN_MASK) != 0))

{

//some actions}

elseif (keyEvent.getKeyCode() == KeyEvent.VK_P &&

keyEvent.getModifiersEx() == KeyEvent.CTRL_DOWN_MASK)

{

//}

[1002 byte] By [sunilbelurgikara] at [2007-11-27 9:51:08]
# 1

Hi, for the apple key, use the keycode below.

switch (e.getKeyCode()){

case KeyEvent.VK_META:{// Apple key

// do what you want...

break;

}

}

for alt you need to use

e.isAltDown();

GeoffTitmussa at 2007-7-13 0:20:09 > top of Java-index,Desktop,Core GUI APIs...