• Greg Spencer's avatar
    Add key event handlers that happen before or after the focus traversal (#136280) · 7e1d366a
    Greg Spencer authored
    ## Description
    
    This adds a mechanism for listening to key events before or after focus traversal occurs.
    
    It adds four methods to the public `FocusManager` API:
    
    - `addEarlyKeyEventHandler` - Adds a handler that can handle events before they are given to the focus tree for handling.
    - `removeEarlyKeyEventHandler` - Removes an early event handler.
    - `addLateKeyEventHandler` - Adds a handler that can handle events if they have not been handled by anything in the focus tree.
    - `removeLateKeyEventHandler` - Removes a late event handler.
    
    This allows an app to get notified for a key anywhere, and prevent the focus tree from seeing that event if it handles it.
    
    For the menu system, this allows it to eat an escape key press and close all the open menus.
    
    ## Related Issues
     - https://github.com/flutter/flutter/issues/135334
    
    ## Tests
     - Added tests for new functionality.
    7e1d366a
Name
Last commit
Last update
..
animation Loading commit data...
cupertino Loading commit data...
foundation Loading commit data...
gestures Loading commit data...
material Loading commit data...
painting Loading commit data...
physics Loading commit data...
rendering Loading commit data...
scheduler Loading commit data...
semantics Loading commit data...
services Loading commit data...
widgets Loading commit data...
dart_plugin_registrant.dart Loading commit data...