jkuhlmann / gainput

Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
http://gainput.johanneskuhlmann.de/
MIT License
858 stars 103 forks source link

Windows build and multiple Joystick support? #32

Closed sytelus closed 7 years ago

sytelus commented 7 years ago

It would be nice to have a section in readme for how to do Windows build. Also, it would be great to include a sample that shows how to select and use joystick if you have multiple ones. The reason this is important is because Unreal engine has a very poor support for game input devices, especially joysticks on Windows, and this library can really help bridge the gap.

jkuhlmann commented 7 years ago

Windows build is actually rather straight-forward. You need CMake: https://cmake.org/download/ Then you can use it to generate a Visual Studio solution and projects: https://cognitivewaves.wordpress.com/cmake-and-visual-studio/#execute-cmake And from there you can just build as you like.

Regarding joysticks, I'm not sure how well they are supported. The only input source on Windows is Xinput which really only meant for Xbox gamepads. However, this is due there not being any API for gamepads or joysticks. DirectInput is unfortunately deprecated. Have you tried out one or more joysticks?

jkuhlmann commented 7 years ago

Just read your other comment (https://github.com/jkuhlmann/gainput/issues/9#issuecomment-286829419) and thanks for the idea using raw input. So I may have to acquire a joystick.