flame icon indicating copy to clipboard operation
flame copied to clipboard

Windows keyboard movement(RawKeyDownEvent doesn't handle)

Open vlladislav45 opened this issue 3 years ago • 3 comments

Current bug behaviour

  • The movement is performed only diagonally. For example moveDirection(1,1) moveDirection(-1,-1) etc.. That is happening because isKeyDown (final isKeyDown = e is RawKeyDownEvent;) is doesn't handled and the state doesn't return to 0.

Expected behaviour

  • To work properly in 8 directions

Steps to reproduce

  1. The statement was printed inside the onKeyEvent method's BaseGame class which is implemented from 'KeyboardEvents'. Respectively I print the move direction of my component
  2. The print statement returns only diagonally movement and doesn't return 0. Respectively my object does not stop moving

Flutter doctor output

[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19043.928], locale en-US)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.1)
[!] Android Studio (not installed)
[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
[√] Connected device (3 available)

More environment information

  • Flame version: ^1.0.0-releasecandidate.11
  • Platform affected: Windows
  • Platform version affected: Windows 10

More information

  • I used the site's example https://examples.flame-engine.org/#/

vlladislav45 avatar Jun 15 '21 13:06 vlladislav45

Which example was used @vlladislav45 ?

erickzanardo avatar Jun 15 '21 13:06 erickzanardo

https://www.github.com/flame-engine/flame/tree/main/examples%2Flib%2Fstories%2Fcontrols%2Fkeyboard.dart

vlladislav45 avatar Jun 15 '21 13:06 vlladislav45

Perhaps this is due to the Cyrillic keyboard layout or different from the Latin.

MrDeeKey avatar Mar 23 '22 20:03 MrDeeKey

I know this is quite old, but @renancaraujo, were you able to reproduce this issue? If not, we can ask @vlladislav45 to check this again in latest Flame release. If it works now, this can be closed.

ufrshubham avatar Sep 12 '22 05:09 ufrshubham

Couldn't reproduce it on both windows and mac. We have a bug in the logic of the example when there are 3+ keys pressed, but nothing related to anything in the engine.

renancaraujo avatar Sep 12 '22 13:09 renancaraujo