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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to