Reputation: 49
How to get the modify Shift key in cocoa. I am making an application and getting the values of all keys using Key code but not able to get the value of (Shift+modify key). Can anybody tell me how i can get this. I have no idea about this. Please provide me help. I am new bie in cocoa.
for all key code in MAC.
Upvotes: 0
Views: 326
Reputation: 54783
See the documention at here. There's a - (NSUInteger)modifierFlags
method that returns the modifiers for the event. An you'll find the modifier flags here.
Edit some sample code to get the key :
-(void)keyDown:(NSEvent*)event {
NSString * character = [event characters];
unichar keyCode = [character characterAtIndex:0];
NSLog(@" - Keydown -\n >>%@<< ->> %c %i<<",character,keyCode, keyCode);
}
Upvotes: 1