summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:07:23 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:55:40 +0100
commitbf5931532f91107747cc45befffb5cc189777c89 (patch)
treea1c5d99a971e04ad5a9e89f158941fcb711c7ff2 /gui
parenta9860e951757bf454b83b13ce7eff865f0b6644e (diff)
work: use the centralized keypress worker
Diffstat (limited to 'gui')
-rw-r--r--gui/keyboard.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/gui/keyboard.h b/gui/keyboard.h
index 75226aa3..696df605 100644
--- a/gui/keyboard.h
+++ b/gui/keyboard.h
@@ -13,13 +13,12 @@ class KeyboardListener : public QLabel
Q_OBJECT
Ui_keyboard_listener ui;
#ifdef _WIN32
- KeybindingWorker w;
+ KeybindingWorker::Token token;
#endif
public:
KeyboardListener(QWidget* parent = nullptr) : QLabel(parent)
#ifdef _WIN32
- , w([&](Key& k)
- {
+ , token([&](const Key& k) {
if(k.guid != "")
{
int mods = 0;
@@ -35,14 +34,11 @@ public:
if (win_key::to_qt(k, k_, m))
key_pressed(static_cast<QVariant>(k_).toInt() | m);
}
- }, this->winId())
+ })
#endif
{
ui.setupUi(this);
setFocusPolicy(Qt::StrongFocus);
-#ifdef _WIN32
- w.start();
-#endif
}
#ifndef _WIN32
void keyPressEvent(QKeyEvent* event) override