The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Xbox controller button press generates undesired axis event
wardjk


Joined: 10 Sep 2015
Posts: 6
I'm encountering an undesired axis motion event with value changes upon pressing or releasing an Xbox 360 controller button. Other than that, everything else seems to be working as desired: all axes provide linear values and button presses register properly except for the mixed signals. The problem seems to be due to something like timing or message parsing at a lower level. All axes properly range from 32767 to -32768 and fluctuate around a reasonable dead zone. Regardless of axis position, the axis value will deviate up to one or two hundred points, positive or negative, upon pressing any button and will return to the original value upon releasing the button. The affected axis is not consistent and may also affect two or three axes simultaneously. The undesired events are fired for both SDL_CONTROLLERAXISMOTION and SDL_JOYAXISMOTION. I'm using SDL2 version 2.0.3 on Windows 7. This behavior doesn't occur when testing with control panel > Gameport Controllers (gameport.cpl).

Does anyone have an idea of what might be causing this or how it can be prevented?
wardjk


Joined: 10 Sep 2015
Posts: 6
This behavior is not limited to SDL. I discovered that the same symptoms also occur when using XInput instead of SDL. When I previously used gameport.cpl for troubleshooting, I did not perceive the undesired axis changes because it uses small graphic indicators only (bars & crosshair) without showing values, however, slight movement can be seen. I searched for variations of "Xbox 360 controller button press changes axis value" but didn't find anything directly related to the problem. I posted a report and question about this anomaly in the more appropriate Xbox 360 forum (http://forums.xbox.com/xbox_support/xbox_360_support/f/7/t/2040334.aspx).