mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 03:15:43 +08:00
fix!: Migrate from RawKeyEvent to KeyEvent (#3002)
First pass at migrating from `RawKeyEvent` and `RawKeyboard` to `KeyEvent` and `HardwareKeyboard`. Context: https://docs.flutter.dev/release/breaking-changes/key-event-migration
This commit is contained in:
@ -44,7 +44,7 @@ class EmberPlayer extends SpriteAnimationComponent
|
||||
}
|
||||
|
||||
@override
|
||||
bool onKeyEvent(RawKeyEvent event, Set<LogicalKeyboardKey> keysPressed) {
|
||||
bool onKeyEvent(KeyEvent event, Set<LogicalKeyboardKey> keysPressed) {
|
||||
horizontalDirection = 0;
|
||||
horizontalDirection += (keysPressed.contains(LogicalKeyboardKey.keyA) ||
|
||||
keysPressed.contains(LogicalKeyboardKey.arrowLeft))
|
||||
|
||||
@ -5,6 +5,7 @@ version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
flutter: ^3.19.0
|
||||
|
||||
dependencies:
|
||||
flame: ^1.15.0
|
||||
|
||||
Reference in New Issue
Block a user