diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-07 14:15:18 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-07 14:15:18 +0200 |
commit | 5f5ca66c58ad30d0c218b2da904aa3f722e18ebe (patch) | |
tree | 8e8d5bae3ca7edf6c96c7f0e0da87f347486b045 /opentrack-logic/keybinding-worker.hpp | |
parent | c418644838e99416fb168066bacc28a4cbc36a04 (diff) |
logic/dinput: only ever use a single handle to DIRECTINPUT8 COM object
Diffstat (limited to 'opentrack-logic/keybinding-worker.hpp')
-rw-r--r-- | opentrack-logic/keybinding-worker.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/opentrack-logic/keybinding-worker.hpp b/opentrack-logic/keybinding-worker.hpp index 12237ab0..e38e5046 100644 --- a/opentrack-logic/keybinding-worker.hpp +++ b/opentrack-logic/keybinding-worker.hpp @@ -12,6 +12,7 @@ #include "opentrack-compat/timer.hpp" #include "win32-joystick.hpp" +#include "dinput.hpp" #include <QThread> #include <QMutex> #include <QWidget> @@ -40,25 +41,26 @@ public: struct OPENTRACK_LOGIC_EXPORT KeybindingWorker : private QThread { + using fun = std::function<void(const Key&)>; + private: - LPDIRECTINPUT8 din; LPDIRECTINPUTDEVICE8 dinkeyboard; win32_joy_ctx joy_ctx; - volatile bool should_quit; - using fun = std::function<void(const Key&)>; std::vector<std::unique_ptr<fun>> receivers; QMutex mtx; QMainWindow fake_main_window; + volatile bool should_quit; void run() override; KeybindingWorker(); - KeybindingWorker(const KeybindingWorker&) = delete; - KeybindingWorker& operator=(KeybindingWorker&) = delete; static KeybindingWorker& make(); fun* _add_receiver(fun &receiver); void remove_receiver(fun* pos); ~KeybindingWorker(); + + KeybindingWorker(const KeybindingWorker&) = delete; + KeybindingWorker& operator=(KeybindingWorker&) = delete; public: class Token { |