Page 1 of 1

Button event to wheel axis

Posted: Sat Jul 21, 2018 1:48 am
by gimxaddict
I can't get it to work.

I want to assign a keyboard key to wheel axis, but it's not even available.

Image

Only pedals are available....

Is there a way to assign a kbd key to "wheel left" and another key to "wheel right"?

Re: Button event to wheel axis

Posted: Sat Jul 21, 2018 8:23 am
by Matlo
Hello,

I will consider adding this in a future release.

In the meantime, you can try using macro to achieve this. Bind an axis to the wheel and generate axis movement with a button.
https://gimx.fr/wiki/index.php?title=Macros

Re: Button event to wheel axis

Posted: Sat Jul 21, 2018 8:26 am
by GoDlike
Hello,

Im not a Steering Wheel expert as Matlo but because he's on vacation now I'll try to help.

Please open configuration with text editor, find these lines

Code: Select all

<axis_map>
...
</axis_map>
Add following code inside <axis_map> to make it look like that

Code: Select all

<axis_map>
...
<axis id="rel_axis_0-" label="">
          <device type="keyboard" id="0" name=""/>
          <event type="button" id="a"/>
</axis>
<axis id="rel_axis_0+" label="">
          <device type="keyboard" id="0" name=""/>
          <event type="button" id="d"/>
</axis>
</axis_map>
In theory it should force GIMX to bind keyboard A and D keys to wheel axis even if this option does not seem to be available in gimx-config.

If it doesn't work then make sure rel_axis_0 is correct axis name for wheel axis, you can check that also inside <axis_map>, there should be something like that

Code: Select all

<axis id="rel_axis_0" label="wheel">
          <device type="joystick" id="0" name="Logitech Driving Force GT USB"/>
          <event type="axis" id="0" dead_zone="0" multiplier="0.0039" exponent="1.00" shape=""/>
        </axis>
It means that rel_axis_0 is the wheel axis and if you add lines I wrote before it should work.

Regards,
Daniel

EDIT:: Ah it looks like Matlo replied while I was writing this post. @Matlo could you please check if my idea could work? It's simplier than making a macro.

Re: Button event to wheel axis

Posted: Sat Jul 21, 2018 10:32 am
by Matlo
Yes, it may work.

Re: Button event to wheel axis

Posted: Sat Jul 21, 2018 8:28 pm
by gimxaddict
GoDlike wrote: Sat Jul 21, 2018 8:26 am

If it doesn't work then make sure rel_axis_0 is correct axis name for wheel axis, you can check that also inside <axis_map>, there should be something like that

Code: Select all

<axis id="rel_axis_0" label="wheel">
          <device type="joystick" id="0" name="Logitech Driving Force GT USB"/>
          <event type="axis" id="0" dead_zone="0" multiplier="0.0039" exponent="1.00" shape=""/>
        </axis>
It means that rel_axis_0 is the wheel axis and if you add lines I wrote before it should work.
After reading your valuable reply, my <axis_map> structure was changed to this:

Code: Select all

      <axis_map>
        <axis id="rel_axis_0-" label="">
          <device type="keyboard" id="0" name=""/>
          <event type="button" id="a"/>
		</axis>
		<axis id="rel_axis_0+" label="">
          <device type="keyboard" id="0" name=""/>
          <event type="button" id="d"/>
		</axis>
		<axis id="rel_axis_0" label="wheel">
          <device type="joystick" id="0" name="Logitech G27 Racing Wheel USB"/>
          <event type="axis" id="0" dead_zone="0" multiplier="0.0039" exponent="1.00" shape=""/>
        </axis>
        <axis id="abs_axis_17" label="gas">
          <device type="joystick" id="0" name="Logitech G27 Racing Wheel USB"/>
          <event type="axis" id="1" dead_zone="0" multiplier="0.008" exponent="1.00" shape=""/>
        </axis>
        <axis id="abs_axis_18" label="brake">
          <device type="joystick" id="0" name="Logitech G27 Racing Wheel USB"/>
          <event type="axis" id="2" dead_zone="0" multiplier="0.008" exponent="1.00" shape=""/>
        </axis>
        <axis id="abs_axis_19" label="clutch">
          <device type="joystick" id="0" name="Logitech G27 Racing Wheel USB"/>
          <event type="axis" id="4" dead_zone="0" multiplier="0.008" exponent="1.00" shape=""/>
        </axis>
      </axis_map>
But it's not working.... :(

About the macro suggestion, I didn't find any mention to wheel axis in the wiki, only mouse and joystick axis are specified there....

Am I missing something?

Re: Button event to wheel axis

Posted: Sat Jul 21, 2018 9:12 pm
by GoDlike
You shouldn't change wheel axis number but change my code to match the real wheel axis number. I tested it and it worked, with a gamepad at least. Could you please send us the whole config before changes?

Axises are same for mouses, joysticks and wheels so you can use Macros system.

Re: Button event to wheel axis

Posted: Sat Jul 21, 2018 11:12 pm
by gimxaddict
Will post the whole config as soon as I can.

Thanks!

Re: Button event to wheel axis

Posted: Fri Aug 10, 2018 12:12 pm
by Matlo
This should be fixed in GIMX 7.8: viewtopic.php?f=2&t=2704
Feedback is very welcome!