Joystick Axis mapping issue: Axis returns 0/0 when Joystick is at South-West

Hello everyone,

I encountered a problem with my gamepads which i dont know how to solve:

While the axis[0] and axis[1] (input of one physical joystick element on a gamepad) behave as expected in center, west, north-west, north, north-east, east, south-east and south, it returns both axis zero for south-west, what makes it the same value as center. What - how you can probably imagine - makes movement functions pretty messed up.

The problem is most probably not related to my code since i std::cout<< the axes right after polling them via glfwGetJoystickAxes().

Already tried to callibrate the devices in windows configurations, everything seams to work fine there. Is this a known issue? Anyone had similar problems or some kind of idea how to fix or workaround?

Edit: Just recognized another problem: The Y-Axis which is accessed by the L2 and R2 buttons on the front side of the gamepad is only affected by R2 which raises its value gradually from -1 to 1, while when no button is pressed the value is 0, and its 0 as well if only L2 is pressed.

What version of GLFW are you using? Joystick input has changed and improved with version 3.2.

I am using the 3.2.1, glfwGetVersionString() returns 3.2.1 Win32 WGL EGL VisualC. This should be up to date, isnt it?

GLFW 3.2.1 is the latest version, with 3.3 in progress source available via Github https://github.com/glfw/glfw.

I’m not sure what’s going on here, but adding information on what OS version (Windows 8.1 etc) and what the controller is might help. If you’re able to test the controller in SDL2 this might also be useful to help track things down.

The Controller is a very cheap Piranha PS3/PC Controller: https://www.amazon.de/Playstation-PC-Piranha-Controller-kabelgebunden/dp/B01N8U1BIK/ref=sr_1_10?ie=UTF8&qid=1479823000&sr=8-10&keywords=Controller+Piranha

My OS is Windows 7 Home Premium Service Pack 1 64bit. I plan to check if the same problem appears with an xbox controller and if the problem is reproduceable on my notebook as well, as soon as I am at home.

Edit: Cant check SDL2 since for some annoying reasons my internet access is limited to my smartphone for another week.

Results:
The axis-problem did NOT occur, when trying with an XBox-Controller (“Microsoft Xbox 360 Controller for Windows”),
The second problem was pretty much staring at the screen: I didnt know, that L2 and R2 are assigned to one axis slot each, and adding them up makes another axis.
So its pretty much solved, besides the point that the piranha controller gives wrong inputs at south-west when using with glfw.

Do you have a source build of GLFW? If so you can help debugging by looking at win32_joystick.c function pollJoystickState and seeing whether your js->device is NULL (XInput) or not (DirectInput). You can then hopefully drill down to look at how each axis is constructed in order to see if the error is in the code, or in the value obtained from DirectInput or XInput.

Without the joystick to hand the only thing I can think of is that the value for SW is in the deadzone, but that S and W aren’t.