DavidoTek/ProtonUp-Qt

[Feature Request] Add More Keyboard Shortcuts

sonic2kk opened this issue ยท 6 comments

Is your feature request related to a problem? Please describe.
Nope, this is a very minor quality-of-life idea.

Describe the solution you'd like
It dawned on me recently that ProtonUp-Qt does not have many keyboard shortcuts. I wanted to open this issue to gauge whether or not it would be desirable to have more keyboard shortcuts and, if so, what those shortcuts should be. Here's a rough list of what I was thinking:

  • Quit: Ctrl+Q (#205)
  • Show Info dialog: Alt+Enter
    • This shows the Properties dialog in KDE's Dolphin file explorer, but a more universal and intuitive shortcut is very welcome!
  • Remove Compat Tool: Del button, or some modifier key + backspace for keyboards which don't have a delete key
  • Add Compat Tool: Ctrl+N?
    • Not fully sold on this one to be honest. There is also the possibility of having different keyboard shortcuts as shorthands for opening the new dialog with a default compat tool selected. Maybe something like Ctrl+Alt+G for GE-Proton and so on. Not totally sure on this either, just an idea I had ๐Ÿ˜…
    • I'm also cautious that maybe this should be used for the Custom Install Directory option. Though I'm not sure how widely used this is, and this option could instead be set to Shift+Ctrl+N
  • About dialog: F1
    • This is a somewhat-standard "Help" button, it's even built-in with QKeySequence.HelpContents

I should state that I am more than happy to implement these shortcuts myself, but I would like to get some feedback on what the shortcuts should be beforehand.

Describe alternatives you've considered
Using the "Tab" key to navigate the UI, which works, but intuitive keyboard shortcuts would be nicer I think. Emphasis on Intuitive, which is a big part of what I want feedback on.

Adding a shortcut to open a dialog is as straightforward as a one-line call to QShortcut(QKeySequence('shortcut'), self.ui).activated.connect(func) (or a lambda to here to pass data to an existing method if it requires it). The important part is getting the shortcuts right.

Additional context
I don't think it would be fitting necessarily to add these as tooltips, but documenting the shortcuts somewhere might be a good idea. Or they could be left as "easter eggs" heheh ;-)

Great idea!
I think users who regularly use ProtonUp-Qt will benefit a lot.

I should state that I am more than happy to implement these shortcuts myself, but I would like to get some feedback on what the shortcuts should be beforehand.

Awesome! Let me know if you need anything else from me.

Remove Compat Tool: Del button, or some modifier key + backspace for keyboards which don't have a delete key

I wonder if it should desplay a message box asking if the tool should be deleted if the button is accedentally pressed.
Though I think that it is not that critical as reinstalled is quite simple and even the configuration won't be changed.

Add Compat Tool: Ctrl+N?
Maybe something like Ctrl+Alt+G for GE-Proton

Ctrl+N sounds about right.
Having shortcuts for individual compatibility tools would be a nice enhancement. We have two options for this. Either, as you suggested, add a shortcut Ctrl+Alt+<something> for most common compatibility tools or alternatively, pressing Ctrl+N and then selecting a tool using the letters (e.g. G=GE-Proton, S=SteamTinkerLaunch). That currently works if the upper combobox is in focus. I'm open on this though.

I'm also cautious that maybe this should be used for the Custom Install Directory option. Though I'm not sure how widely used this is, and this option could instead be set to Shift+Ctrl+N

I don't think it's that widely used. If we go so far to add shortcuts, I think we can add one for this as well.
Using Shift+Ctrl+<something> seems to be the right choice for something that isn't used often.

About dialog: F1

I think many apps use Ctrl+. for opening the settings. But as it is called About, I think we can use F1 as well ๐Ÿ˜„

Adding a shortcut to open a dialog is as straightforward as a one-line call to QShortcut(QKeySequence('shortcut'), self.ui).activated.connect(func)

Very good.

don't think it would be fitting necessarily to add these as tooltips, but documenting the shortcuts somewhere might be a good idea. Or they could be left as "easter eggs" heheh ;-)

We could add a section to the README/Flathub description/About dialog.

I wonder if it should desplay a message box asking if the tool should be deleted if the button is accedentally pressed. Though I think that it is not that critical as reinstalled is quite simple and even the configuration won't be changed.

I entirely agree and thought about this too. It will still show a message box if the compat tool is in use, but if the tool is not in use then even the remove button will not display a dialog. Granted, it is easier (in my opinion anyway) to accidentally press the Delete key on a keyboard. I think it is a lot more deliberate to press the Remove button on the UI.

or alternatively, pressing Ctrl+N and then selecting a tool using the letters (e.g. G=GE-Proton, S=SteamTinkerLaunch). That currently works if the upper combobox is in focus. I'm open on this though.

I tested this out a bit and I think the overlap in tool names ("SteamTinkerLaunch" and "Steam-Play-None" for example) makes the dedicated shortcuts a better fit, i.e. Ctrl+Alt+T for Proton-tkg.

This approach will mean creating a way to pass the compat tool name to the install dialog, which from taking a (very quick) glance, it doesn't seem like a major issue. Just something to call out :-)

We could add a section to the README/Flathub description/About dialog.

Sounds great! ๐Ÿ˜„

Something that occurred to me is that there could be potential accessibility enhancements too around this, in regards to navigating without a mouse (see this note from GitHub). I wonder if there are any other areas where this could be improved as well. Projects especially in recent years have made a strong push to improve accessibility support, though I'm not sure that would be involved to implement this on the ProtonUp-Qt/PySide6 side. And it would probably be a separate enhancement proposal as well, though one that I don't have enough of a background on accessibility to really propose myself, apart from just bringing the idea up.

Was looking at potentially adding a shortcut to switch between launchers, but Qt already has this built in it seems! With the main widget focused (i.e. without the compat tool list selected) you can press Alt + the first letter of the launcher to switch to it:

  • Alt+S switches to Steam
  • Alt+L switches to Lutris
  • Alt+H will switch to Heroic, first selecting Heroic Wine and then pressing again will switch to Heroic Proton - This is the order the launchers appear in the dropdown which explains why Wine is preferred here

I initially tested this to see if these shortcuts were already taken or something and that's how I found out they are already in place. Nifty! ๐Ÿ˜„

Note to myself @DavidoTek: For easier keyboard navigation, the Tab Order should be changed. Also the NoFocus policy should not be used if not needed. See #215 (comment)

With #217 merged and v2.8.0 released, I guess this can be closed ๐Ÿ˜„ Seems like the work related to keyboard shortcuts is complete!