• 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
Making custom key-commands
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making custom key-commands


  • Subject: Making custom key-commands
  • From: James Maxwell <email@hidden>
  • Date: Mon, 17 Dec 2007 11:50:04 -0800

Hello All,

I'm new to Cocoa and Objective-C, having recently started a project to port a music notation-based GUI I've been writing in Java/Processing, over to Cocoa. There are a number of reasons for the change, the main one being that Processing is really hard on the cpu!

Things are basically going fine, but I'm a bit stumped about handling key strokes, particularly in the sense of creating my own key- commands. Can anyone clarify the best way to go about this? Even just starting with something simple, like using backspace and/or delete to delete the selected object (from a custom view - I don't need help with the deleting part... just registering the delete/backspace). Some places say to override keyDown, while others suggest this isn't a good idea, and I'm finding Apple's documentation more than a little bit confusing on what best-practice really is.
Other examples of the things I need to do would be things like creating particular subclasses of objects if a given key is held at the time the object is created, or toggling an attribute of a given object using a specific key. This stuff is all really simple in Processing, and probably simple enough in Cocoa, but I've no idea where to start...


Any help or pointers greatly appreciated - and code snippets even more so! ;-)

thanks,

J.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Making custom key-commands
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: NSColorPanel as sheet?
  • Next by Date: Re: NSColorPanel as sheet?
  • Previous by thread: Re: NSColorPanel as sheet?
  • Next by thread: Re: Making custom key-commands
  • Index(es):
    • Date
    • Thread