Multi axis controller reports cumulative axis values

I have Space Navigator 3D mouse, which is a HID multi axis controller. This has translation X, Y, Z, and rotation X, Y, Z, and two buttons. I can see that glfw already supports this device as a joystick, with a twist.

For my device, glfwGetJoystickAxes() does not return the current axis values (this is what I want). Instead, it returns cumulative values from all the history, and I need to compute deltas myself to get the current axis values. I wonder if this is something that glfw does on purpose? Or maybe glfw does not have any code specifically for HID multiaxis controllers? I only had a quick look at the joystick code in glfw, I did not spot any HID multiaxis controller specific code there.

In case the reporting of cumulative values is not intentionally done by glfw, and this “feature” is result of missing support specifically for multiaxis controllers: Would it be useful to have multiaxis specific support in glfw, using joystick API, reporting current state instead of cumulative values? Using Windows HID apis directly, I can get the current axis values instead of cumulative values.

Hi @tksuoran,

Welcome to the GLFW forum.

I wonder if this is something that glfw does on purpose? Or maybe glfw does not have any code specifically for HID multiaxis controllers?

GLFW does not have any specific code for this, and the values reported are those available from the joystick or gamepad OS APIs. These values are absolute rather than deltas.

I am a little confused as to what the values you are getting are. You mention cumulative and deltas but also current axis values. Normally for a joystick the OS reports the absolute value, i.e. a number representing the angle of the joystick. Is this what you are getting?