Option key on mac


hi. i am having a problem working with keypresses on mac that use the option or alt key. in the code below the first two cases work fine but the last fails.

examples of what i do get from various option + key

option+a keycode 229, modifier 4
option+e keycode 0, modifier 4
option+u keycode 0, modifier 4
optiont+j keycode 8710, modifier 4

from looking over the code it seems the following may be the issue

void MyComponent::keyPressed(const KeyPress &key)
KeyPress control_space = KeyPress(KeyPress::spaceKey, ModifierKeys::ctrlModifier);
KeyPress command_e = KeyPress(‘e’, ModifierKeys::commandModifier);
KeyPress option_a = KeyPress(‘a’, ModifierKeys::altModifier);

if(key == control_space)
printf(“control space\n”);

if(key == command_e)

if(key == option_a)

printf(“keycode %i, modifier %i”, key.getKeyCode(), key.getModifiers().getRawFlags());



Yeah, I’ve already got this on my list of things to look at…


ok. also i noticed control+letter always returns the uppercase keycode. and also return and enter are recognized as the same keys.