BenL0
BenL0

Reputation: 287

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 and 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.

Upvotes: 0

Views: 460

Answers (1)

Wevah
Wevah

Reputation: 28242

IIRC, control-key events are handled by -performKeyEquivalent: instead of -keyDown:, so I'd try that.

Upvotes: 1

Related Questions