Turbo (Hold) hotkey#1969
Open
DavidRGriswold wants to merge 2 commits intoazahar-emu:masterfrom
Open
Conversation
Requred expanding the GApplicationFilter class to contain a set of sequences to filter, a helper method to filter custom sequences, and some new signals and slots. The GApplicationFilter is now a local variable of citra_qt so that sequences can be added by the InitializeHotkeys function.
Collaborator
Author
|
Pursuant to #1976 , this PR could be updated to automatically disable vsync when the turbo hold button is pressed or that could be left for another potential PR. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Turbo (Hold) hotkey to both android and desktop.
Implementation Details
On android, a
handleHotkeyReleasemethod was added for when a hotkey is released that is used to toggle turbo off after the existinghandleHotkeyPressmethod turned it on. Most of the infrastructure for this was already there, that commit is relatively small.On desktop, a new implementation for "hold" shortcuts was needed, as standard shortcuts do not trigger anything on release. I added to the existing GApplicationFilter class, adding a set of sequences to filter for and signals for when such a sequence is found and released, plus a helper method to detect an arbitrary sequence manually. Those signals are hooked up to functions in GMainWindow that run the appropriate methods. the sequence is added to the filter in initializeHotkeys, which required making the filter a member variable of GMainWindow rather than a local variable.
Todo
AI Disclosure
Claude helped me write the helper method for detecting a key sequence. It is not long enough to be reasonably copyrightable and I cleaned it up a bit anyway.
Issues
Closes #1739