My current project will benefit from uniform support for Keyboard, Gamepad, and Racing Wheel, but I am at the mercy of the InputManager and the controllers which map their axes in different ways. I have tested the Xbox Controller, WingMan cordless gamepad, and Thrustmaster Ferrari Challenge Wheel.
Axis X: Steering [is ok]
- Xbox: Left stick horizontal, InputManager value resting at 0, range [-1,1]
- WingMan: Left stick horizontal, InputManager value resting at 0, range [-1,1]
- Wheel: Wheel centered, InputManager value resting at 0, range [-1,1]
Axis Y:
- Xbox: Left stick Vertical, InputManager value resting at 0, range [-1,1]
- WingMan: Left stick Vertical, InputManager value resting at 0, range [-1,1]
- Wheel: Left (brake) pedal, InputManager value resting at 1, range [1,-1]
Axiz Z/3:
- Xbox: Left Trigger + Right Trigger, (resting at 0, range [0,1])+(resting at 0, range [0,-1])
- WingMan: Throttle Slider, inverted, range [-1,1]
- Wheel: Right (accelerator) pedal, InputManager value resting at 1, range [1,-1]
Problem:
For my driving game, Steering is just fine, but I also want values from brake and accelerator in the range [0,1]. The racing wheel’s pedals will need to be remapped to more sensible values, given their rest state and range.
Hypothesis:
I expect the solution to involve bypassing the InputManager in some fashion. I could configure the InputManager’s axes to allow me access each possible axis. The value would be interpreted during Update() according to the name of the controller detected. This will limit support to those devices for which I code custom mappings. Also, the user will need to have only one controller plugged in at a time.
TL;DR: Is there a GOOD way around the InputManager for mapping and calibrating ANY controller from within the game?