You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
I want to work with raw input (windows) and thought this library was a good fit for me.
I tried to modify the listener example to use raw input but was not able to do so.
Steps to reproduce:
Build the project for x64 (I used VS2017 Community)
Change the following code snippet in listenersample.cpp: manager.CreateDevice<gainput::InputDeviceKeyboard>(gainput::InputDevice::DV_RAW); const gainput::DeviceId keyboardId = manager.CreateDevice<gainput::InputDeviceKeyboard>(); manager.CreateDevice<gainput::InputDeviceMouse>(gainput::InputDevice::DV_RAW); const gainput::DeviceId mouseId = manager.CreateDevice<gainput::InputDeviceMouse>(); manager.CreateDevice<gainput::InputDevicePad>(); manager.CreateDevice<gainput::InputDevicePad>(); manager.CreateDevice<gainput::InputDeviceTouch>();
to const gainput::DeviceId keyboardId = manager.CreateDevice<gainput::InputDeviceKeyboard>(gainput::InputDevice::AutoIndex, gainput::InputDevice::DV_RAW); //manager.CreateDevice<gainput::InputDeviceKeyboard>(); const gainput::DeviceId mouseId = manager.CreateDevice<gainput::InputDeviceMouse>(gainput::InputDevice::AutoIndex, gainput::InputDevice::DV_RAW); //manager.CreateDevice<gainput::InputDeviceMouse>(); //manager.CreateDevice<gainput::InputDevicePad>(); //manager.CreateDevice<gainput::InputDevicePad>(); //manager.CreateDevice<gainput::InputDeviceTouch>();
Run the sample project
Observe that there is no mouse input being reported
Potential solution:
I believe that the problem lies in how the library gets the raw input data in GainputInputDeviceMouseWinRaw.h and GainputInputDeviceKeyboardWinRaw.h
For x64 dwSize variable must be 48 instead of 40. A better way would be to get the size needed from the system itself.
I want to work with raw input (windows) and thought this library was a good fit for me.
I tried to modify the listener example to use raw input but was not able to do so.
Steps to reproduce:
Build the project for x64 (I used VS2017 Community)
Change the following code snippet in listenersample.cpp:
manager.CreateDevice<gainput::InputDeviceKeyboard>(gainput::InputDevice::DV_RAW);const gainput::DeviceId keyboardId = manager.CreateDevice<gainput::InputDeviceKeyboard>();manager.CreateDevice<gainput::InputDeviceMouse>(gainput::InputDevice::DV_RAW);const gainput::DeviceId mouseId = manager.CreateDevice<gainput::InputDeviceMouse>();manager.CreateDevice<gainput::InputDevicePad>();manager.CreateDevice<gainput::InputDevicePad>();manager.CreateDevice<gainput::InputDeviceTouch>();to
const gainput::DeviceId keyboardId = manager.CreateDevice<gainput::InputDeviceKeyboard>(gainput::InputDevice::AutoIndex, gainput::InputDevice::DV_RAW);//manager.CreateDevice<gainput::InputDeviceKeyboard>();const gainput::DeviceId mouseId = manager.CreateDevice<gainput::InputDeviceMouse>(gainput::InputDevice::AutoIndex, gainput::InputDevice::DV_RAW);//manager.CreateDevice<gainput::InputDeviceMouse>();//manager.CreateDevice<gainput::InputDevicePad>();//manager.CreateDevice<gainput::InputDevicePad>();//manager.CreateDevice<gainput::InputDeviceTouch>();Run the sample project
Observe that there is no mouse input being reported
Potential solution:
I believe that the problem lies in how the library gets the raw input data in GainputInputDeviceMouseWinRaw.h and GainputInputDeviceKeyboardWinRaw.h
For x64
dwSizevariable must be 48 instead of 40. A better way would be to get the size needed from the system itself.Check the revisions of this gist.
NOTE: I have used C++ 11 features (shared_ptr) for my modifications.
Kindly let me know if you need anything more from my side