Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcut Editor: Add 'Find' and 'Save' keyboard shortcuts #357

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

sonic2kk
Copy link
Contributor

Overview

When using the Shortcut Editor (which is my new favourite thing 馃槃) I instinctively pressed "Ctrl+F" to focus the search bar. I figured it would be a useful bit of functionality, so I decided to add it!

While adding it, I also thought a save shortcut would be handy, so I added that too.

There is some precedent for keyboard shortcuts in ProtonUp-Qt, as we already have some on the Main Menu, so I think it's okay to add them to the Shortcut Editor too 馃檪

Implementation

These shortcuts are bound using QKeySequence.Find and QKeySequence.Save, which are Qt's built-in per-platform "constants" (I guess?) for these actions. Since we're only targetting Linux with ProtonUp-Qt, it isn't a huge deal, but I think it's nicer to be explicit with a shortcut key combination called "Save" rather than the very, very slightly more ambiguous "Ctrl+S". This is also what we already use for the keyboard shortcuts on the Main Menu.

To wire up the shortcuts:

  • The "Find" shortcut has a lambda attached to it that just sets the focus to the searchBox widget.
  • The "Save" shortcut just connects to the existing btn_save_clicked method.

If this change is desired, there is room for other shortcuts too, such as Ctrl+N for creating a new shortcut row. Open to all discussion 馃槃

Future Work

We could probably document these shortcuts on the brand-new wiki to give a bit more visibility on this change. We could have a page for keyboard shortcuts, with a per-screen table of available shortcuts. I'd be happy to take a stab at the markup and attach it to a discussion as I can't directly edit the wiki.


Thanks!

@DavidoTek
Copy link
Owner

Thanks!

We could probably document these shortcuts on the brand-new wiki to give a bit more visibility on this change. We could have a page for keyboard shortcuts, with a per-screen table of available shortcuts.

Good suggestion.

I'd be happy to take a stab at the markup and attach it to a discussion as I can't directly edit the wiki.

Here you go, I've already created a discussion: #358

I think you would need to clone the Wiki and somehow create a PR. I've never tried that before though.

@DavidoTek DavidoTek merged commit 6cf1def into DavidoTek:main Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants