flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.29k stars 913 forks source link

Keyboard #372

Closed therockerline closed 4 years ago

therockerline commented 4 years ago

When I have one key pressed and at the same time I press another one, then the RawKeyUpEvent event is triggered for the first key even if I am still physically pressing it and for the second key the RawKeyDownEvent event is triggered as it should be. Later if I actually release the first key, the RawKeyUpEvent event is called again. Is there any solution for these problems?

erickzanardo commented 4 years ago

Which platforms does this happens? Can you share a reproducible code of this?

Be aware that keyboard support is totally provided by Flutter class RawKeyboard, so this could be a problem originating there.

therockerline commented 4 years ago

I'm experiencing the problem with flutter web. In the android version it's a mess. If I press a key, each frame makes an event change between RawKeyDownEvent and RowKeyUpEvent making it impossible to use the keyboard. Also in the web version labelName is null so I can understand what key I am pressing only via debugName or the keyId, but this is not very important. This is the link of a minimal project that shows the problem I encountered. https://github.com/therockerline/flame_keyboard_issue.git

erickzanardo commented 4 years ago

Okay, I have made a small plain flutter example and was able to reproduce the problem, this is seems to be a Flutter issue, I have opened an issue there: https://github.com/flutter/flutter/issues/58727

Keeping this open to track the problem.

erickzanardo commented 4 years ago

Sent a PR to address this on the flutter engine: https://github.com/flutter/engine/pull/19632

erickzanardo commented 4 years ago

Solved by the PR mentioned above.