Re: Capture "Space" key event
Re: Capture "Space" key event
- Subject: Re: Capture "Space" key event
- From: Matt Jaffa <email@hidden>
- Date: Fri, 5 Mar 2004 08:41:10 -0700
Allan,
I looked at the online documentation,
There is no keyDown or sendEvent Method in the NSTableView.
So How can I overide by subclassing the NSTableView, when it does not
exist?
Matt
On Mar 5, 2004, at 8:33 AM, Allan Odgaard wrote:
On 5. Mar 2004, at 16:20, Matt Jaffa wrote:
In my Program I tried making my window it a subclass of NSWindow
And using that keyDown:(NSEvent*)anEvent
to get the delete key so I can delete a row from my NSTableView,
but it is not working, in fact the keyDown is not getting any events
at all.
Is there something I am missing?
As I understand it, NSApp will get the event from the main event loop,
it will pass it on to the window which has stat as key using
sendEvent:, the window will send the event to the first responder
using keyDown: or whatever matches the event -- if the first responder
does not implement this method, the default implementation will pass
it on to the next object in the responder chain a.s.o.
So only if no-one implements keyDown: in the responder chain will your
window receive a keyDown: (or if those who do implement it, decides to
pass on the message to the next responder).
So you should probably overwrite sendEvent: instead of keyDown:, if
you insist on placing this in your window subclass (it ought to be in
the table view subclass).
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.