summaryrefslogtreecommitdiffhomepage
path: root/opentrack/shortcuts.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-25 05:18:01 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-25 05:18:01 +0200
commit8494245b92e02f982a506ed044a555db239bd4d6 (patch)
tree1e95e64f71114ec038b8bab0cc6d7685b642925e /opentrack/shortcuts.cpp
parent37c10386155bc4fed4db910fcd5c7662347f576e (diff)
shortcuts: store .ini value as portable string
Diffstat (limited to 'opentrack/shortcuts.cpp')
-rw-r--r--opentrack/shortcuts.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp
index d68da30e..81393ae3 100644
--- a/opentrack/shortcuts.cpp
+++ b/opentrack/shortcuts.cpp
@@ -132,18 +132,25 @@ void Shortcuts::bind_keyboard_shortcut(K &key, key_opts& k)
key->setShortcut(QKeySequence::UnknownKey);
}
- if (k.keycode)
+ if (k.keycode != "")
{
- key->setShortcut(QKeySequence(k.keycode));
+ key->setShortcut(QKeySequence::fromString(k.keycode, QKeySequence::PortableText));
key->setEnabled();
}
}
#else
key = K();
int idx = 0;
+ QKeySequence seq;;
+
+ if (k.keycode == "")
+ code = QKeySequence(Qt::Key_unknown);
+ else
+ code = QKeySequence::fromString(k.keycode, QKeySequence::PortableText)
+
Qt::KeyboardModifiers mods = Qt::NoModifier;
- if (k.keycode != Qt::Key_unknown)
- win_key::from_qt(QKeySequence(k.keycode), idx, mods);
+ if (code != Qt::Key_unknown)
+ win_key::from_qt(code, idx, mods);
key.shift = !!(mods & Qt::ShiftModifier);
key.alt = !!(mods & Qt::AltModifier);
key.ctrl = !!(mods & Qt::ControlModifier);