View Single Post
Three

 
Member Since: Nov 26, 2006
Posts: 18
Three is on a distinguished road

Three is offline
Not to bump the post but:
Just in case anyone is interested. I have found one way. You can load the StandardKeyBinding.dict dictionary file and check the key-value using the return from [anEvent characters] as the key.

Code:
- (void)keyDown:(NSEvent *)anEvent
{
	if ([anEvent modifierFlags] & NSFunctionKeyMask) {
		if ([[keyBindings objectForKey:[anEvent characters]] isEqual:@"moveLeft:"]) {
			NSLog(@"leftArrow"); 
		}
		if ([[keyBindings objectForKey:[anEvent characters]] isEqual:@"moveRight:"]) {
			NSLog(@"rightArrow");
		}
		if ([[keyBindings objectForKey:[anEvent characters]] isEqual:@"moveDown:"]) {
			NSLog(@"downArrow");
		}
		if ([[keyBindings objectForKey:[anEvent characters]] isEqual:@"moveUp:"]) {
			NSLog(@"upArrow");
		}
	}
}
If anyone knows a better way, for that matter any other way, please let me know.
QUOTE Thanks