summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-11 15:29:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-11 15:29:07 +0100
commite8edf8b4498ff79ae62751cadb9b61ac6569e25d (patch)
tree4a2f696b2cc4db73bfb0e42571561c118007fcd2 /gui
parentc8805112acca1ba3bd0056fcf0b9332c4ba10f03 (diff)
options: stringify keyboard mods for joy buttons
Diffstat (limited to 'gui')
-rw-r--r--gui/options-dialog.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp
index 4cff6e77..9631d41e 100644
--- a/gui/options-dialog.cpp
+++ b/gui/options-dialog.cpp
@@ -15,7 +15,15 @@
static QString kopts_to_string(const Shortcuts::key_opts& kopts)
{
if (static_cast<QString>(kopts.guid) != "")
- return "Joystick button " + QString::number(kopts.button);
+ {
+ const int btn = kopts.button & ~Qt::KeyboardModifierMask;
+ const int mods = kopts.button & Qt::KeyboardModifierMask;
+ QString mm;
+ if (mods & Qt::ControlModifier) mm += "Control+";
+ if (mods & Qt::AltModifier) mm += "Alt+";
+ if (mods & Qt::ShiftModifier) mm += "Shift+";
+ return mm + "Joy button " + QString::number(btn);
+ }
if (static_cast<QString>(kopts.keycode) == "")
return "None";
return kopts.keycode;