• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSButton's setKeyEquivalent and arrow keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: performClose for carbon window?
  • Next by Date: Re: GUI without IB
  • Previous by thread: Re: Best Practice for implementing NSUndoManager?
  • Next by thread: Panther's NSScreen vs. screen resolution changes
  • Index(es):
    • Date
    • Thread