• 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
Re: Arrow keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arrow keys


  • Subject: Re: Arrow keys
  • From: email@hidden
  • Date: Tue, 19 Mar 2002 18:25:48 -0800

Using the Interface Builder, is it possible to connect a button with an
arrow key?

I don't know.

If that isn't possible, can I add some code into my cocoa
app which will then call the same functions as the associated arrow
buttons?

Look at overriding keyDown: in your NSResponder subclass (an NSView subclass, perhaps, or an NSWindow subclass) and checking for NSUpArrowFunctionKey and the other three. Should be quite straightforward. NSResponder is pretty well documented; look at how the responder chain works for key events, and look at NSEvent's documentation for how to get the character typed, the modifier keys, etc.
Good luck.

Ben Haller
Stick Software
_______________________________________________
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: Code for a Control with a continuous action
  • Next by Date: Re: Scripting a Cocoa app
  • Previous by thread: Re: Arrow keys
  • Next by thread: Re: Arrow keys
  • Index(es):
    • Date
    • Thread