• 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: NSTableView + delete button?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView + delete button?


  • Subject: Re: NSTableView + delete button?
  • From: "Kevin Dixon" <email@hidden>
  • Date: Tue, 11 Mar 2008 20:47:45 -0400 (EDT)
  • Importance: Normal

>
> On Mar 11, 2008, at 3:03 PM, Kevin Dixon wrote:
>
>> I'm using an NSTableView, and I want to be able to remove items from
>> the
>> list by pressing the delete key on the keyboard. What is the
>> procedure to
>> receive a message when a key is pressed and the table view has focus?
>
>
> Subclass NSTableView and override "-keyDown:". There should be several
> implementations of this online that you could take a look at.
>
> j o a r

I have implemented -keyDown as such

if([theEvent type] == NSKeyDown) {
	if([theEvent keyCode] == 51) {
		//process 'delete' press
	}
}

to catch the pressing of delete on the NSTableView. This works, but
reminds me of BASIC...Is there a better way to do this, to make sure I'm
getting the delete key, say even on international keyboards?

-Kevin
_______________________________________________

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: NSTableView + delete button?
      • From: "Sean McBride" <email@hidden>
    • Re: NSTableView + delete button?
      • From: j o a r <email@hidden>
References: 
 >NSTableView + delete button? (From: "Kevin Dixon" <email@hidden>)
 >Re: NSTableView + delete button? (From: j o a r <email@hidden>)

  • Prev by Date: Re: Launch Daemon Best Practices?
  • Next by Date: Re: NSTask and process group IDs
  • Previous by thread: Re: NSTableView + delete button?
  • Next by thread: Re: NSTableView + delete button?
  • Index(es):
    • Date
    • Thread