Re: Capture "Space" key event
Re: Capture "Space" key event
- Subject: Re: Capture "Space" key event
- From: Allan Odgaard <email@hidden>
- Date: Fri, 5 Mar 2004 16:33:01 +0100
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.