diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-30 08:34:40 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-30 08:39:33 +0100 |
commit | 2160e39a4f3d5198eafbb483671583a5a0b51eaa (patch) | |
tree | 2370dd4e9a7b43c204d175af3ab2a0ff5b33c41d /facetracknoir/keyboard.h | |
parent | aa066bdd4622d4f6824fee864f6be6806813f04d (diff) |
rename gui directory
Diffstat (limited to 'facetracknoir/keyboard.h')
-rw-r--r-- | facetracknoir/keyboard.h | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/facetracknoir/keyboard.h b/facetracknoir/keyboard.h deleted file mode 100644 index 62a9ce20..00000000 --- a/facetracknoir/keyboard.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once -#include "ui_keyboard_listener.h" -#ifdef _WIN32 -#include "opentrack/win32-shortcuts.h" -#include "opentrack/shortcuts.h" -#endif -#include <QLabel> -#include <QKeyEvent> -#include <QDebug> - -class KeyboardListener : public QLabel -{ - Q_OBJECT - Ui_keyboard_listener ui; -#ifdef _WIN32 - KeybindingWorker w; -#endif -public: - KeyboardListener(QWidget* parent = nullptr) : QLabel(parent) -#ifdef _WIN32 - , w([&](Key& k) - { - Qt::KeyboardModifiers m; - QKeySequence k_; - 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 - { - //qDebug() << "k" << (event->key() | event->modifiers()); - switch (event->key() | event->modifiers()) - { - default: - emit key_pressed(QKeySequence(event->key() | event->modifiers())); - break; - } - } -#endif -signals: - void key_pressed(QKeySequence k); -}; |