Button event to wheel axis

Need help? Ask here and someone will help
Post Reply
gimxaddict
Posts: 5
Joined: Sat Jul 21, 2018 1:41 am

Button event to wheel axis

Post 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"?
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Button event to wheel axis

Post 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
GIMX creator
User avatar
GoDlike
Posts: 1317
Joined: Thu Apr 28, 2016 12:47 pm
Location: Poland

Re: Button event to wheel axis

Post 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.
My hardware: PS3 Slim CFW 4.80 | PS4 Pro 500 Million LE | PS5 | Xbox Series X
Steam: Godlike_RU | PSN: GoDlike_RU | XBL: GoDlike
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Button event to wheel axis

Post by Matlo »

Yes, it may work.
GIMX creator
gimxaddict
Posts: 5
Joined: Sat Jul 21, 2018 1:41 am

Re: Button event to wheel axis

Post 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?
User avatar
GoDlike
Posts: 1317
Joined: Thu Apr 28, 2016 12:47 pm
Location: Poland

Re: Button event to wheel axis

Post 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.
My hardware: PS3 Slim CFW 4.80 | PS4 Pro 500 Million LE | PS5 | Xbox Series X
Steam: Godlike_RU | PSN: GoDlike_RU | XBL: GoDlike
gimxaddict
Posts: 5
Joined: Sat Jul 21, 2018 1:41 am

Re: Button event to wheel axis

Post by gimxaddict »

Will post the whole config as soon as I can.

Thanks!
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Button event to wheel axis

Post by Matlo »

This should be fixed in GIMX 7.8: viewtopic.php?f=2&t=2704
Feedback is very welcome!
GIMX creator
Post Reply