Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always reset all keyboard and mouse buttons to released when window f…
…ocus is lost on all platforms. Previously, this was left up to the platform. On Windows this almost always worked because mouse button state was checked on every mouse move message. On macOS this did nothing, so if you held down left mouse button, went to another application, released left mouse and then came back to the game, it'd still think the left mouse was down, so once you closed the menu, the game started deleting blocks. On linux the window still seemed to get a 'mouse up' even when the window wasn't focused anymore, although I didn't rigorously test this. For the web client, seemed to get 'mouse up' tooin chrome, not sure if other browsers had issues. SDL backend wasn't tested.
- Loading branch information
1 parent
b26ab73
commit ca72cf6
Showing
3 changed files
with
10 additions
and
14 deletions.
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
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