• 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
..
flutter Loading commit data...
flutter_driver Loading commit data...
flutter_goldens Loading commit data...
flutter_goldens_client Loading commit data...
flutter_localizations Loading commit data...
flutter_test Loading commit data...
flutter_tools Loading commit data...
flutter_web_plugins Loading commit data...
fuchsia_remote_debug_protocol Loading commit data...
integration_test Loading commit data...
analysis_options.yaml Loading commit data...