diff options
author | Donovan Baarda <abo@minkirri.apana.org.au> | 2014-06-12 14:53:43 +1000 |
---|---|---|
committer | Donovan Baarda <abo@minkirri.apana.org.au> | 2014-06-12 14:53:43 +1000 |
commit | 0669a40347ffa233bc6042b0f65d244509a61394 (patch) | |
tree | 36a4577bdaa1ed28ca1ad222a54777012dd2dda8 /facetracknoir/shortcuts.h | |
parent | 72540e0a96a3120a5d02271e714aba29e136ab78 (diff) | |
parent | 7454496476ba17ea622781d280606161581c9544 (diff) |
Merge branch 'master' of https://github.com/opentrack/opentrack into dev/ewma2
Resolved conflicts manually in files:
ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
Diffstat (limited to 'facetracknoir/shortcuts.h')
-rw-r--r-- | facetracknoir/shortcuts.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/facetracknoir/shortcuts.h b/facetracknoir/shortcuts.h new file mode 100644 index 00000000..f8c34be7 --- /dev/null +++ b/facetracknoir/shortcuts.h @@ -0,0 +1,85 @@ +#pragma once +#include <QWidget> +#include <QElapsedTimer> +#include <QThread> +#include <QMessageBox> +#include <QCheckBox> +#include <QComboBox> +#include <QSettings> +#include "ui_ftnoir_keyboardshortcuts.h" + +class FaceTrackNoIR; + +class KeyboardShortcutDialog: public QWidget +{ + Q_OBJECT +public: + + KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent ); +private: + Ui::UICKeyboardShortcutDialog ui; + FaceTrackNoIR *mainApp; + +private slots: + void doOK(); + void doCancel(); +}; + +extern QList<QString> global_key_sequences; + +#if defined(_WIN32) +extern QList<int> global_windows_key_sequences; +# undef DIRECTINPUT_VERSION +# define DIRECTINPUT_VERSION 0x0800 +# include <windows.h> +# include <dinput.h> + +struct Key { + BYTE keycode; + bool shift; + bool ctrl; + bool alt; + bool ever_pressed; + QElapsedTimer timer; +public: + Key() : keycode(0), shift(false), ctrl(false), alt(false), ever_pressed(false) + { + } +}; +#else +typedef unsigned char BYTE; +struct Key { int foo; }; +#endif + +#if defined(_WIN32) +class KeybindingWorkerImpl { +private: + LPDIRECTINPUT8 din; + LPDIRECTINPUTDEVICE8 dinkeyboard; + Key kCenter; + Key kToggle; + FaceTrackNoIR& window; +public: + volatile bool should_quit; + ~KeybindingWorkerImpl(); + KeybindingWorkerImpl(FaceTrackNoIR& w, Key keyCenter, Key keyToggle); + void run(); +}; +#else +class KeybindingWorkerImpl { +public: + KeybindingWorkerImpl(FaceTrackNoIR& w, Key keyCenter, Key keyToggle); + void run() {} +}; +#endif + +class KeybindingWorker : public QThread, public KeybindingWorkerImpl { + Q_OBJECT +public: + KeybindingWorker(FaceTrackNoIR& w, Key keyCenter, Key keyToggle) : KeybindingWorkerImpl(w, keyCenter, keyToggle) + { + } + void run() { + KeybindingWorkerImpl::run(); + } +}; |