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/win32-joystick.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/win32-joystick.hpp')
-rw-r--r-- | dinput/win32-joystick.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dinput/win32-joystick.hpp b/dinput/win32-joystick.hpp index 4e72853f..4d2dd344 100644 --- a/dinput/win32-joystick.hpp +++ b/dinput/win32-joystick.hpp @@ -43,9 +43,12 @@ struct OTR_DINPUT_EXPORT win32_joy_ctx { LPDIRECTINPUTDEVICE8 joy_handle; QString guid, name; - bool pressed[128 + 4 * 4]; + enum { num_pressed_keys = 128 + 4 * 4 }; + //bool pressed[num_pressed_keys] {}; Timer first_timer; + static DIDEVICEOBJECTDATA keystate_buffers[256]; + joy(LPDIRECTINPUTDEVICE8 handle, const QString& guid, const QString& name); ~joy(); |