From bf5931532f91107747cc45befffb5cc189777c89 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 22 Nov 2015 15:07:23 +0100 Subject: work: use the centralized keypress worker --- gui/keyboard.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gui') 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(k_).toInt() | m); } - }, this->winId()) + }) #endif { ui.setupUi(this); setFocusPolicy(Qt::StrongFocus); -#ifdef _WIN32 - w.start(); -#endif } #ifndef _WIN32 void keyPressEvent(QKeyEvent* event) override -- cgit v1.2.3