• 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
.github Loading commit data...
.vscode Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...