From 1505029bb1dec3b9a56221d4a1a21485fb852e0a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Sep 2021 12:05:50 +0200 Subject: [PATCH] Prevent the use of modifier keys as actual key bindings (closes #1744) --- .../ext/launcher/src/profile/actiondialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp index f547c8c7af..8dbdf4471e 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp @@ -306,6 +306,17 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) { _keybindingWidgets.key = new QComboBox; QStringList keyList; for (const KeyInfo& ki : KeyInfos) { + // We don't want to use the Shift, Alt, and Ctrl keys directly since we already + // have them as modifier keys + if (ki.key == Key::LeftShift || ki.key == Key::RightShift || + ki.key == Key::LeftAlt || ki.key == Key::RightAlt || + ki.key == Key::LeftControl || ki.key == Key::RightControl || + ki.key == Key::LeftSuper || ki.key == Key::RightSuper || + ki.key == Key::Menu || ki.key == Key::NumLock || + ki.key == Key::World1 || ki.key == Key::World2) + { + continue; + } keyList += QString::fromStdString(std::string(ki.name)); } _keybindingWidgets.key->addItems(keyList);