• 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
..
lib Loading commit data...
test Loading commit data...
test_fixes Loading commit data...
test_private Loading commit data...
test_profile Loading commit data...
test_release Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
analysis_options.yaml Loading commit data...
build.yaml Loading commit data...
dart_test.yaml Loading commit data...
pubspec.yaml Loading commit data...