Cocoa: Fix handling of analog joystick buttons

From upstream: https://github.com/glfw/glfw/commit/463ef7eb71268f57790fdb67f26d328b45d3346e
This commit is contained in:
Kovid Goyal
2019-02-03 20:16:47 +05:30
parent c31c32f921
commit fb5dbc811b
+2 -1
View File
@@ -426,7 +426,8 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
_GLFWjoyelementNS* button = (_GLFWjoyelementNS*)
CFArrayGetValueAtIndex(js->ns.buttons, i);
const char value = getElementValue(js, button) - button->minimum;
_glfwInputJoystickButton(js, (int) i, value);
const int state = (value > 0) ? GLFW_PRESS : GLFW_RELEASE;
_glfwInputJoystickButton(js, (int) i, state);
}
for (i = 0; i < CFArrayGetCount(js->ns.hats); i++)