DescriptionMacViews: Intercept events for Menus (after AppKit has interpreted keystrokes)
Currently keystrokes while a menu is open are sent to the window hosting
the menu, since it remains `key`. Concretely, this causes all the Menu*
interactive_ui_tests to fail since they simulate pressing ESC to dismiss
the menu in the tests.
Other platforms insert an event dispatcher into the message pump for the
nested run loop that shows a menu, and redirect KeyDown events to the
MenuController.
On Mac, events need to be mapped to "Action" messages by an NSResponder
to obey platform behaviour and user customizations (e.g. a "Home"
keypress should be interpreted as beginning of document, not beginning
of line).
The approach in this CL is to check in BridgedContentView, an
NSResponder, for an active menu that should be receiving events instead.
Action messages are mapped to the KeyCode that toolkit-views expects for
that action, and the MenuController is given an opportunity to swallow
the event or have it sent on to the key window.
BUG=403679
Patch Set 1 #Patch Set 2 : Always interpretkeyevents #Patch Set 3 : nicer logic, comments, nits #Patch Set 4 : rollback card unmask #
Total comments: 2
Patch Set 5 : rebase #Patch Set 6 : another rebase #Patch Set 7 : remap all the things. But I do not like it any more - should do something more like linux-aura #Patch Set 8 : Nice #Patch Set 9 : Gonna have to make a dispatcher :/ #Patch Set 10 : Now actually working #Patch Set 11 : Fix ControlAndSelectTest and InsertionDeletionTest for native events #Patch Set 12 : Self review #Patch Set 13 : rebase, and fix aura omgworstgotchaever #Patch Set 14 : Various cleanups #Patch Set 15 : A few more cleanups #Messages
Total messages: 6 (3 generated)
|