-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
isLogicalKeyPressed
to KeyEvent
(#136856)
## 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 - flutter/flutter#136419 ## Tests - Added tests for the new methods.
- Loading branch information
1 parent
4cae1af
commit 5907c97
Showing
3 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters