• 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: Capture "Space" key event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Capture "Space" key event
      • From: Matt Jaffa <email@hidden>
References: 
 >Capture "Space" key event (From: Mathew Peterson <email@hidden>)
 >Re: Capture "Space" key event (From: Allan Odgaard <email@hidden>)
 >Re: Capture "Space" key event (From: Matt Jaffa <email@hidden>)

  • Prev by Date: drag and drop: NSView vs. NSImageView
  • Next by Date: Passing C Style Function Callbacks in Cocoa
  • Previous by thread: Re: Capture "Space" key event
  • Next by thread: Re: Capture "Space" key event
  • Index(es):
    • Date
    • Thread