@M210
While you're at it, make sure you implement:
- a deadzone so the game will filter unwanted input from within the deadzone
- a non-linear response, because it's naturally harder for the thumbs to aim when around that deadzone
The concept and an implementation example I wrote for Quake 1:
https://msdn.microso....aspx#dead_zone
https://github.com/a.../in_win.c#L1203
In my example I show:
- the implementation of the deadzone
- a power to N response, this has many benefits : when power is 1.0 then effect is disabled, anything else like a common value of 3.0 greatly improves usage
Make sure you expose both settings in game options so one can configure them at will !
Last thing, not all joystick libraries are equal when it comes to supporting XBox Controller for Windows:
- old software see triggers as a single axis, resulting in the impossibility to use them
- either the game will not react to any, or will see one as always pushed
- in fact, at rest, this axis value is 0.5 (or anything else) instead of 0.0
A picture is going to explain the problem probably much better than me:
- this is the joystick panel for XB1 controller on Windows 10
- in fact this returns DirectInput driver, for compatibility issues with older apps (newer apps are recommended to use XInput)
Triggers share Z Axis and you see the problem:
- you need to know its real value at rest
- you need to track which trigger is pressed first so that if user presses the other trigger at the same time, you can know it and execute both actions in game
And we will test and report feedback
PS if somehow you could also implement vibration that would really rock !