Forums

Full Version: steering wheel button behaves different than keyboard button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi *,

I am working right now on vamosworld.cpp for my prototype and have some weird problem:

As there is no need in my prototype for a TCS toggle key, I have changed its functionality:

Code:
...
else if (dofunction == "tcs_toggle") {
  // old code
  "some new code"
}
...

Furthermore, I changed the control setting of the TCS toggle key from "once" to "held". If I use the keyboard and press "z" (the default key for TCS toggle), "some new code" is executed as long as I press this button (here: a message is displayed in the HUD).

But if I use my steering wheel (having mapped TCS toggle to one of its buttons - also with the "held" option), "some new code" seems to be executed without the button being pressed (i.e. my message is always displayed in the HUD). Pressing the button does not do anything. I have played around with the settings "button control delay", "held/once" and "up/down" but without success. Any hints on how I can make the steering wheel button behave as the keybord button?

TIA

hj
If you define the button options as down and held in the "assign controls" menu, it should work as you want. For example, I've got a joystick button mapped to the handbrake as held/once and it works fine. Make sure you delete any other controls assigned to that function.

In vamosworld.cpp@1156 you'll find the code for querying for joystick state.