NSButton's setKeyEquivalent and arrow keys
NSButton's setKeyEquivalent and arrow keys
- Subject: NSButton's setKeyEquivalent and arrow keys
- From: "Mark A. Stratman" <email@hidden>
- Date: Tue, 8 Jun 2004 06:04:55 -0500
I'm trying to use the arrow keys as key equivalents with an NSButton.
The problem is that when you press an arrow button, it sends two events
(my guess would be one for NSKeyUp and one for NSKeyDown).
I initially tried:
unichar right = NSRightArrowFunctionKey;
[button setKeyEquivalent:[NSString stringWithCharacters:&right
length:1]];
Then i also tried NSEvent's +keyEventWithType:... using NSKeyDown as
"type". Then used that event's -keyCode method to get the string for
setKeyEquivalent, but that produced the same.
Is there a simple way I can do this without subclassing NSButton (or
something equally involved) ?
Thanks,
Mark
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.