performKeyEquivalent and arrow keys
performKeyEquivalent and arrow keys
- Subject: performKeyEquivalent and arrow keys
- From: Luc Vandal <email@hidden>
- Date: Wed, 23 Mar 2005 09:30:06 -0500
Hi,
I'm using
performKeyEquivalent to track some keyboard events. I have some problems with the arrow keys. I'm using the modifier key to see which arrow key has been pressed. Here's some code:
-(BOOL)performKeyEquivalent:(NSEvent*)event
{
BOOL bHandled = YES;
m_nModifierKey = [event modifierFlags];
m_strKey = [event charactersIgnoringModifiers];
m_bRepeat = [event isARepeat];
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
[center postNotificationName:NSKeyDownNotification object:nil];
return bHandled;
}
- (void)KeyDown:(NSNotification*)notification
{
int nModifier = [m_pWnd GetModifier];
int i=0;
NSString* strKey = [m_pWnd GetKey];
BOOL bRepeat = [m_pWnd GetIsARepeat];
...
...
else if( nModifier & NSRightArrowFunctionKey )
{
//todo
}
Now that I think about it, it probably doesn't make sense to use the modifier value? What is the proper way to handle arrow keys?
Thanks!
Luc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden