Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix stuck keys on ubuntu and on focus loss #142
In the `OnKeyDown` event handler, check if the key is actually pressed using `wxGetKeyState()`, because for some reason on Ubuntu 18 spurious events are generated when the key is not actually pressed. Also, if a game is paused by the frontend while a key is being pressed, the key will remain active for the game when unpaused. This is an issue because the key will likely be released outside of the game zone; therefore, we would not process the key release for the game itself. The same bug happens if clicking outside of the game zone while holding a key. For the case of a directional key, this means a continuous movement in the direction of the key pressed before the pause until the key is pressed and released.
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
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