Key events not getting through to responders
I'm unable to get some key events getting though to the view that I expect to receive them, specifically the control-tab key down event - other keyboard commands work fine.
I've subclassed NSApplication's sendEvent() to see what's happening an开发者_开发问答d when I press control-tab I can log the event firing as a keyDown. But the receiving view's keyDown isn't being called.
In the NSApp I can see that [[NSApp keyWindow] firstResponder] is correctly set - it's targeting a tableView.
I've also tried logging the keyWindow keyDown event, but it's not being fired either.
So how do I find out what's happening to the event?
Or is there something special about control-tab? - Could it be trying to tab through the fields in my view or something?
Oddly the keyUp event always gets through to the view correctly.
IIRC, control-key events are handled by -performKeyEquivalent:
instead of -keyDown:
, so I'd try that.
精彩评论