• 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
..
animation Loading commit data...
cupertino Loading commit data...
dart Loading commit data...
examples Loading commit data...
foundation Loading commit data...
gestures Loading commit data...
harness 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...
_goldens_io.dart Loading commit data...
_goldens_web.dart Loading commit data...
analysis_options.yaml Loading commit data...
flutter_test_config.dart Loading commit data...
image_data.dart Loading commit data...