auriamg / stk-code

The code base of supertuxkart
Other
0 stars 0 forks source link

Steering right fails when accelerometer joystick device is enabled #923

Open auriamg opened 10 years ago

auriamg commented 10 years ago

On my notebook (Thinkpad X220), supertuxkart-0.8.1 failed to steer right when pressing the corresponding cursor key on the keyboard. After debugging the code I realized that PA_STEER_RIGHT actions arrive at the controller classes in high frequency even though no keys are pressed. This obviously caused the car not to steer right. The source for these events was the "ThinkPad HDAPS accelerometer data" joystick device.

This is per se no bug in the logic of supertuxkart, but a very hard to track down misconfiguration. I am not sure how to handle this issue but here are a few proposals:

  1. Do not enable any joystick device per default, but let the user opt-in to enable joystick devices.
  2. Only apply the previous proposal to devices that contain the string "accelerometer" in their name or try to filter out the accelerometer by other means. Actually, there is a legitimate wish to use the accelerometer to steer a car, but the proper device to achieve this is "ThinkPad HDAPS joystick emulation".
  3. Add an entry to your FAQ to point out this possible issue.

Migrated-From: https://sourceforge.net/apps/trac/supertuxkart/t/ticket/1111