• 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
..
fix_data Loading commit data...
src Loading commit data...
analysis_options.yaml Loading commit data...
analysis_options_user.yaml Loading commit data...
animation.dart Loading commit data...
cupertino.dart Loading commit data...
foundation.dart Loading commit data...
gestures.dart Loading commit data...
material.dart Loading commit data...
painting.dart Loading commit data...
physics.dart Loading commit data...
rendering.dart Loading commit data...
scheduler.dart Loading commit data...
semantics.dart Loading commit data...
services.dart Loading commit data...
widgets.dart Loading commit data...