Wheel controller issue

Got strange inspiration to see whether wheel controller works like joystick. Had already joystick test program so ran it. Looks to be working. Detects joystick, plenty of buttons, 3 axis. Axis 0 is wheel itself(left, right), axis 1 seems to be brakes, axis 2 throtle. For throtle and brakes seems to be that when they aren’t pushed they are 32xxx and when they are pushed to full -32xxx. I can work with that. Issue however is that before they are pressed they read 0. That’s VERY inconvinient as after they are pressed 0 would be half-way pushed. Would become rather problematic in say racing game if player doesn’t press throttle AND breaks before start in which case game would decide player is pressing them halfway(especially annoying for brakes…).

Is there way to fix this? Is SDL even suitable for programming wheel controllers? Wheel is thrustmaster wheel which SDL reports correctly(provides string Thrustmaster Thrustmasterforce feedback wheel as it’s name).

Of course one could work around this by notifying at start of program for player to push both but seems rather inconvinient.

You could store the initial value of each axis, then ignore that axis
until the value changes the first time.

Jonny DOn Mon, Nov 2, 2009 at 7:18 PM, tneva82 wrote:

Got strange inspiration to see whether wheel controller works like joystick.
Had already joystick test program so ran it. Looks to be working. Detects
joystick, plenty of buttons, 3 axis. Axis 0 is wheel itself(left, right),
axis 1 seems to be brakes, axis 2 throtle. For throtle and brakes seems to
be that when they aren’t pushed they are 32xxx and when they are pushed to
full -32xxx. I can work with that. Issue however is that before they are
pressed they read 0. That’s VERY inconvinient as after they are pressed 0
would be half-way pushed. Would become rather problematic in say racing game
if player doesn’t press throttle AND breaks before start in which case game
would decide player is pressing them halfway(especially annoying for
brakes…).

Is there way to fix this? Is SDL even suitable for programming wheel
controllers? Wheel is thrustmaster wheel which SDL reports
correctly(provides string Thrustmaster Thrustmasterforce feedback wheel as
it’s name).

Of course one could work around this by notifying at start of program for
player to push both but seems rather inconvinient.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sounds pretty normal to me. Steering wheels are usually expected to be
calibrated before use.

And yes, all game controllers are “joysticks”, including steering
wheels. SDL uses an obsolete old-school terminology (“Joystick”) for
its Game Controller API abstraction.On Mon, Nov 2, 2009 at 19:18, tneva82 wrote:

Got strange inspiration to see whether wheel controller works like joystick.
Had already joystick test program so ran it. Looks to be working. Detects
joystick, plenty of buttons, 3 axis. Axis 0 is wheel itself(left, right),
axis 1 seems to be brakes, axis 2 throtle. For throtle and brakes seems to
be that when they aren’t pushed they are 32xxx and when they are pushed to
full -32xxx. I can work with that. Issue however is that before they are
pressed they read 0. That’s VERY inconvinient as after they are pressed 0
would be half-way pushed. Would become rather problematic in say racing game
if player doesn’t press throttle AND breaks before start in which case game
would decide player is pressing them halfway(especially annoying for
brakes…).

Is there way to fix this? Is SDL even suitable for programming wheel
controllers? Wheel is thrustmaster wheel which SDL reports
correctly(provides string Thrustmaster Thrustmasterforce feedback wheel as
it’s name).

Of course one could work around this by notifying at start of program for
player to push both but seems rather inconvinient.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  • SR

Got strange inspiration to see whether wheel controller works like joystick.
Had already joystick test program so ran it. Looks to be working. Detects
joystick, plenty of buttons, 3 axis. Axis 0 is wheel itself(left, right),
axis 1 seems to be brakes, axis 2 throtle. For throtle and brakes seems to
be that when they aren’t pushed they are 32xxx and when they are pushed to
full -32xxx. I can work with that. Issue however is that before they are
pressed they read 0. That’s VERY inconvinient as after they are pressed 0
would be half-way pushed. Would become rather problematic in say racing game
if player doesn’t press throttle AND breaks before start in which case game
would decide player is pressing them halfway(especially annoying for
brakes…).

Is there way to fix this? Is SDL even suitable for programming wheel
controllers? Wheel is thrustmaster wheel which SDL reports
correctly(provides string Thrustmaster Thrustmasterforce feedback wheel as
it’s name).

I don’t believe this is a property of racing wheels, nor SDL, nor
racing wheels with SDL. It may be a property of your Thrustmaster, or
of the drivers you’re using for it.

I have seen this sort of thing with many hardware access APIs and many
gaming devices. It has always been kind of a pain.

Of course one could work around this by notifying at start of program for
player to push both but seems rather inconvinient.

It is, but it’s what I’ve always done. From the perspective of a
gaming controller manufacturer, some kind of dynamic definition of
range seems like an attractive decision, since it means the device
won’t become uncalibrated over time.

If someone with a great deal more knowledge on the subject would like
to chime in, I’d love a history lesson :)On Mon, Nov 2, 2009 at 7:18 PM, tneva82 wrote:


http://codebad.com/