FROM : Kevin Dixon
DATE : Wed Mar 12 01:47:45 2008
>
> 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
DATE : Wed Mar 12 01:47:45 2008
>
> 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
| Related mails | Author | Date |
|---|---|---|
| Kevin Dixon | Mar 11, 23:03 | |
| j o a r | Mar 11, 23:12 | |
| Quincey Morris | Mar 12, 00:00 | |
| Kevin Dixon | Mar 12, 01:47 | |
| j o a r | Mar 12, 02:00 | |
| Sean McBride | Mar 12, 15:43 |






Cocoa mail archive

