diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-02 08:09:14 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-02 08:09:14 +0200 |
commit | d6589a028919c671a3005d32202cdbbaf5caa010 (patch) | |
tree | 69766bb404e0cdd38c30672a3f1d708182c9da8e /opentrack/shortcuts.h | |
parent | d626a60eca7a511786435ec796d7864c59463939 (diff) |
shortcuts: rework KeybindingWorker for win32
The class is now usable outside of center/zero/toggle loop.
Diffstat (limited to 'opentrack/shortcuts.h')
-rw-r--r-- | opentrack/shortcuts.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h index 2d7fec54..8877b5bb 100644 --- a/opentrack/shortcuts.h +++ b/opentrack/shortcuts.h @@ -67,19 +67,15 @@ struct Shortcuts; struct KeybindingWorker : public QThread { #ifdef _WIN32 private: - Shortcuts& sc; LPDIRECTINPUT8 din; LPDIRECTINPUTDEVICE8 dinkeyboard; - Key kCenter; - Key kToggle; - Key kZero; QMutex mtx; public: volatile bool should_quit; + std::function<void(Key&)> receiver; ~KeybindingWorker(); - KeybindingWorker(Key keyCenter, Key keyToggle, Key keyZero, WId handle, Shortcuts& sc); + KeybindingWorker(std::function<void(Key&)> receiver, WId h); void run(); - void set_keys(Key kCenter, Key kToggle, Key kZero); #else public: KeybindingWorker(Key, Key, Key, WId) {} @@ -124,6 +120,9 @@ public: void reload(); private: void bind_keyboard_shortcut(K &key, key_opts& k); +#ifdef _WIN32 + void receiver(Key& k); +#endif signals: void center(); void toggle(); |