GLFW Joystick bug in v78h (including fix)

Monkey Forums/Monkey Bug Reports/GLFW Joystick bug in v78h (including fix)

mr_twister(Posted 2014) [#1]
I noticed that joysticks are way better supported in this version than in previous versions (v76 and older) so kudos!
However for joysticks with less than 12 buttons all the buttons start (and remain) stuck in "pressed down" state (something that never happened before).

The bug -however- seems to be a simple typo:

In glfwgame.cpp, the line 146:
for( int i=0;i<n_buts;++i ) buttons[i]=(buts[i]=-GLFW_PRESS);

Should (as hinted by the other cases) be:
for( int i=0;i<n_buts;++i ) buttons[i]=(buts[i]==GLFW_PRESS);

(There's a =- instead of ==)

Hope this can be fixed in the next release :)


marksibly(Posted 2014) [#2]
Thanks! I don't actually have any joysticks with <12 buttons, so this code was never even tested - oops...