I have subclassed NSWindow in a NSDocument application in order to receive keyDown events.
I have used the following code in my subclasss...
- (void)keyDown:(NSEvent *)theEvent {
NSLog(@"keyDown!");
if ([theEvent modifierFlags] & NSAlternateKeyMask) {
NSLog(@"Alt key Down!");
}
else
[super keyDown:theEvent];
}
I'm receiving key events when non-modifier keys are pressed! I'm also receiving "Alt Key is Down" when I press alt+z for example (alt+non-modifierkey).
The issue here is that I want to handle the event when just the alt/option key is pressed alone, without in combination with other keys and -keyDown: does not get called! What am I missing ?
Thanks...