Closed therockerline closed 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.
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
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.
Sent a PR to address this on the flutter engine: https://github.com/flutter/engine/pull/19632
Solved by the PR mentioned above.
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 theRawKeyDownEvent
event is triggered as it should be. Later if I actually release the first key, theRawKeyUpEvent
event is called again. Is there any solution for these problems?