I recognize which key user enter in textfield with below code.but i can’t recognize keys like ‘Caps lock’ – ‘shift’ – ‘control’ – ‘command’ – ‘option’ – ‘tab’ how can i recognize them ?
- (void)keyUp:(NSEvent *)theEvent
{
unichar keyChar = 0;
keyChar = [theArrow characterAtIndex:0];
NSString *aci=[NSString stringWithFormat:@"%d",keyChar];
}
Those are modifier keys and they don’t generate
NSKeyDownandNSKeyUpevents. They generateNSFlagsChangedevents. The correspondingNSRespondermethod is-flagsChanged:.