summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-25 03:23:29 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-25 03:23:29 +0200
commit5ca330e1fd5890ad4504abd5c63f2802e0d2bb87 (patch)
treee9677bf0c9856430de5a5cd5fb0e567d7a433db0
parent95114eccc774bbb0fbeade8904aafa4f9b6d143d (diff)
shortcuts: linux work
-rw-r--r--opentrack/shortcuts.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp
index 190c4003..56071418 100644
--- a/opentrack/shortcuts.cpp
+++ b/opentrack/shortcuts.cpp
@@ -125,12 +125,18 @@ void KeybindingWorker::run() {
void Shortcuts::bind_keyboard_shortcut(K &key, key_opts& k)
{
#if !defined(_WIN32)
- key->setEnabled(false);
- key->setShortcut(QKeySequence::UnknownKey);
+
+ if (key)
+ {
+ key->setEnabled(false);
+ key->setShortcut(QKeySequence::UnknownKey);
+ }
+
+ key = std::make_shared<QxtGlobalShortcut>();
if (k.keycode)
{
- key->setShortcut(Qt::KeySequence(k.keycode));
+ key->setShortcut(QKeySequence(k.keycode));
key->setEnabled();
}
}
@@ -144,8 +150,8 @@ void Shortcuts::bind_keyboard_shortcut(K &key, key_opts& k)
key.alt = !!(mods & Qt::AltModifier);
key.ctrl = !!(mods & Qt::ControlModifier);
key.keycode = idx;
-#endif
}
+#endif
void Shortcuts::reload() {
#ifndef _WIN32