diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-29 20:58:15 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-29 20:58:15 +0100 |
commit | 1d994c21ff978daeb8ae72a5ab4b0fad287b9959 (patch) | |
tree | fdc6daf8e28e01b6878f6924f4fb0e3056cba6cb /dinput/keybinding-worker.hpp | |
parent | 33aa2b6bbbf6edbe2d0173a03a9869e7ed7a2660 (diff) |
dinput: use buffered polling
Short keyboard and mouse events won't get dropped. We
can now decrease the poll interval from 250 Hz to 10Hz.
Diffstat (limited to 'dinput/keybinding-worker.hpp')
-rw-r--r-- | dinput/keybinding-worker.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dinput/keybinding-worker.hpp b/dinput/keybinding-worker.hpp index d35ac57d..f7314482 100644 --- a/dinput/keybinding-worker.hpp +++ b/dinput/keybinding-worker.hpp @@ -49,6 +49,9 @@ private: QMainWindow fake_main_window; dinput_handle::di_t din; + unsigned char keystate[256] {}; + unsigned char old_keystate[256] {}; + void run() override; bool init(); KeybindingWorker(); @@ -58,6 +61,9 @@ private: void remove_receiver(fun* pos); ~KeybindingWorker(); + static constexpr int num_keyboard_states = 128; + DIDEVICEOBJECTDATA keyboard_states[num_keyboard_states]; + KeybindingWorker(const KeybindingWorker&) = delete; KeybindingWorker& operator=(KeybindingWorker&) = delete; public: |