Fix certain game actions only recognizing first shortcut (#6059)

* doc

* Fix non-counter shortcuts

* Fix counter shortcuts
This commit is contained in:
RickyRister 2025-08-01 19:45:26 -07:00 committed by GitHub
parent e10dd4ef42
commit fd12a1f6be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 72 deletions

View file

@ -115,6 +115,13 @@ ShortcutKey ShortcutsSettings::getShortcut(const QString &name) const
return getDefaultShortcut(name);
}
/**
* Gets the first shortcut for the given action.
*
* NOTE: In most cases you should be using ShortcutsSettings::getShortcut instead,
* as that will return all shortcuts if there are multiple shortcuts.
* The only reason to use this method is if an object does not accept multiple shortcuts, such as with QButtons.
*/
QKeySequence ShortcutsSettings::getSingleShortcut(const QString &name) const
{
return getShortcut(name).at(0);