summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-11-14 12:46:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-11-14 12:51:18 +0100
commit801bb3b40a70b87b6c9e2c1b1d7d2ba2b7ba8d59 (patch)
tree9741019b3bc3d2f52ed449c977ecf50cc2224f88
parent1171d33839f67c903f108fc25d43f7855fee209b (diff)
gui/keyboard: fix binding keys
-rw-r--r--gui/keyboard.cpp2
-rw-r--r--gui/settings.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp
index aa8f67a3..dbc3ab3a 100644
--- a/gui/keyboard.cpp
+++ b/gui/keyboard.cpp
@@ -19,7 +19,7 @@ auto keyboard_listener::make_token()
Qt::KeyboardModifiers m;
QKeySequence k_;
if (win_key::to_qt(k, k_, m))
- emit key_pressed({ int(m), int(k_) });
+ emit key_pressed({ int(m) | int(k_) });
}
};
}
diff --git a/gui/settings.cpp b/gui/settings.cpp
index 5ee59260..711fb0f0 100644
--- a/gui/settings.cpp
+++ b/gui/settings.cpp
@@ -168,8 +168,8 @@ void options_dialog::closeEvent(QCloseEvent *)
void options_dialog::bind_key(key_opts& kopts, QLabel* label)
{
kopts.button = -1;
- kopts.guid = "";
- kopts.keycode = "";
+ kopts.guid = {};
+ kopts.keycode = {};
auto k = new keyboard_listener;
k->setWindowModality(Qt::ApplicationModal);
k->deleteLater();
@@ -180,7 +180,7 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label)
[&](const QKeySequence& s)
{
kopts.keycode = s.toString(QKeySequence::PortableText);
- kopts.guid = "";
+ kopts.guid = {};
kopts.button = -1;
k->close();
});
@@ -191,7 +191,7 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label)
if (!held)
{
kopts.guid = guid;
- kopts.keycode = "";
+ kopts.keycode = {};
kopts.button = idx;
k->close();
}
@@ -208,8 +208,8 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label)
);
if (is_crap)
{
- kopts.keycode = QStringLiteral("");
- kopts.guid = QStringLiteral("");
+ kopts.keycode = {};
+ kopts.guid = {};
kopts.button = -1;
label->setText(tr("None"));
}