• 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
Delete action from variety of key presses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Delete action from variety of key presses


  • Subject: Delete action from variety of key presses
  • From: Nathan Vander Wilt <email@hidden>
  • Date: Mon, 7 Jul 2008 15:29:09 -0700

I want to be able to delete the items selected in a view, but am struggling finding a best way to turn the different key presses into a -delete: action that my controller can handle. I think I want (it seems expected functionality anyway) the delete key, the forward delete key, as well as Cmd-Delete to all trigger this action.

I could assign one of those as a Key Equivalent for the Edit>Delete menu item, but that leaves the other two out in the cold. Furthermore, several applications (Keynote, iTunes) don't show any such key equivalent yet accept some or all of those keystrokes to delete a selection. iPhoto has Photos>Move To Trash equivalized to Cmd-Delete, but also performs that action if simply Delete is pressed. So I'm not finding a lot of clues in existing applications.

A search through the archives would have me either a) add hidden buttons equivalent to these keys or b) subclass view(s) to handle the keystrokes myself. The first option seems really, really hackish but the second option means I'd have to subclass any view that could be key when the user wants to delete, and implement the same keychecking method in each. Is there a cleaner way to let my controller know whenever the user wants "delete"? Or am I making this too complicated to begin with somehow?

thanks,
-natevw
_______________________________________________

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: Delete action from variety of key presses
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: garbage collection and NSConnection
  • Next by Date: Re: Why aren't my bindings firing?
  • Previous by thread: Re: Releasing objects causes BAD_ACCESS
  • Next by thread: Re: Delete action from variety of key presses
  • Index(es):
    • Date
    • Thread