I'm writing an AppKit application that within its window may open up a popup menu to resolve ambiguities when certain hot keys are pressed. My problem is that the popup seems to catch all keyboard events so they no longer end up in my main NSView and therefore the main view never seems the key up event. The user presses alt+tab, clicks something in the menu, and my app things alt and tab are still pressed when the popup is gone. Since it's a popup, there is also no event indicating that the window became deactive or otherwise lost focus because it didn't.
Is there:
- a way for the view to still receive at least the key up that opened the popup?
- a way to read all currently pressed keys (I only know of NSEvent modifierKeys) so I can restore the correct state when I know the popup closes?
Thanks