From e8edf8b4498ff79ae62751cadb9b61ac6569e25d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 11 Nov 2015 15:29:07 +0100 Subject: options: stringify keyboard mods for joy buttons --- gui/options-dialog.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(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(kopts.keycode) == "") return "None"; return kopts.keycode; -- cgit v1.2.3