summaryrefslogtreecommitdiffhomepage
path: root/opentrack/shortcuts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack/shortcuts.cpp')
-rw-r--r--opentrack/shortcuts.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp
index 56071418..d68da30e 100644
--- a/opentrack/shortcuts.cpp
+++ b/opentrack/shortcuts.cpp
@@ -125,15 +125,13 @@ void KeybindingWorker::run() {
void Shortcuts::bind_keyboard_shortcut(K &key, key_opts& k)
{
#if !defined(_WIN32)
-
- if (key)
- {
+ if (!key)
+ key = std::make_shared<QxtGlobalShortcut>();
+ else {
key->setEnabled(false);
key->setShortcut(QKeySequence::UnknownKey);
}
- key = std::make_shared<QxtGlobalShortcut>();
-
if (k.keycode)
{
key->setShortcut(QKeySequence(k.keycode));