• Greg Spencer's avatar
    Add `isLogicalKeyPressed` to `KeyEvent` (#136856) · 5907c975
    Greg Spencer authored
    ## Description
    
    Adds some convenience methods to `KeyEvent` that allow testing to see if a logical or physical key is pressed from the event object. These are similar to the ones already on `RawKeyEvent`, and will make migration the to `KeyEvent` easier (so it could more easily be a `flutter fix` migration).
    
    Added:
    
    - `bool isLogicalKeyPressed(LogicalKeyboardKey key)`
    - `bool isPhysicalKeyPressed(PhysicalKeyboardKey key)`
    - `bool get isControlPressed`
    - `bool get isShiftPressed`
    - `bool get isAltPressed`
    - `bool get isMetaPressed`
    
    ## Related Issues
     - https://github.com/flutter/flutter/issues/136419
    
    ## Tests
     - Added tests for the new methods.
    5907c975
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...