Qt/GameList: Use KeyPress instead of KeyRelease #8723
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
This fixes a bug where pressing Enter in the "Do you want to stop the current emulation?" confirmation popup also triggers a KeyRelease in GameList, which starts a new game. This is because the popup closes on KeyPress with the Enter key (I believe because of the Qt autodefault Yes button), which gives focus back to the main window, which receives the KeyRelease event. I have encountered this bug on both Arch Linux and Ubuntu 18.04 -- I'm not sure if this affects other systems.
Listening for KeyPress instead of KeyRelease in GameList fixes this issue. I think it makes more sense this way because we don't want to trigger a key event for the GameList when the key was pressed somewhere else. Please let me know if this fix is acceptable, thanks!