IT WORKS!!!!
Just some small tweaks... wasn't getting anywhere with using the z axis so swapped the arduino code over to use X-axis instead as I figured that should at least tie up to Axis 1 and 1X in the lua files.
The code for my arduino is here:
https://drive.google.com/file/d/0B-dX4aJqNBTraEMtbFpvVkw1bWM/view?usp=sharing
my inputbindings.lua now has this entry for my handbrake:
--Arduino
{
Device = EnumDeviceFamily.I_ICF_STEERING_WHEEL,
Index = 5,
GUID = { 2151031617, },
},
As you can see I haven't actually mapped anything to it, unlike the entries for other devices in this file, but it does tell the game that the arduino is a 'steering wheel' so it can be used in axis detection.
The Inputdeviceconfig.lua has this:
--Arduino Handbrake
{
GUID = { 2151031617, },
Axis =
{
{
ControlId = GenericDeviceControlId.I_ICI_GENERICDEVICE_AXIS1_X,
DIAxis = DirectInputState.Axis1X,
Filter = FilterType.Stick,
},
},
},
In the game I went into steering wheel, axis detection and then clutch. I pulled the handbrake. The game showed 'Arduino Leonardo' as the controller name, but the bar move like it does with my wheel.
Then on to button mappings, went down to handbrake, CTRL to edit and pulled the handbrake. The screen then showed this:
That's it... simple as that lol Works perfectly as an analogue handbrake
Here's my run on Panzerplatte Arena trying it out....