Skip to content

Turbo (Hold) hotkey#1969

Open
DavidRGriswold wants to merge 2 commits intoazahar-emu:masterfrom
DavidRGriswold:turbo_hold_hotkey
Open

Turbo (Hold) hotkey#1969
DavidRGriswold wants to merge 2 commits intoazahar-emu:masterfrom
DavidRGriswold:turbo_hold_hotkey

Conversation

@DavidRGriswold
Copy link
Copy Markdown
Collaborator

@DavidRGriswold DavidRGriswold commented Mar 31, 2026

Summary

Adds a Turbo (Hold) hotkey to both android and desktop.

Implementation Details

On android, a handleHotkeyRelease method was added for when a hotkey is released that is used to toggle turbo off after the existing handleHotkeyPress method 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

  • Test on Mac
  • Test on Linux
  • Test on Windows

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

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.
@DavidRGriswold
Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add turbo hold hotkey

1 participant