Controller doesn't work properly on OS X

Monkey Forums/Monkey Bug Reports/Controller doesn't work properly on OS X

taumel(Posted 2013) [#1]
Wow, i'm surprised that this still doesn't work. :O/

I can't get any button (JOY_A, JOY_B, ...) input from the Xbox 360 controller correctly (Wired, OS X 10.8.5, GLFW, 72b/74a). What i do get is the analog input from the left thumb controller (JOYX/Y).

I a.o. have them working properly in Unity or Munro's Xbox 360 controller driver.

*update*

Joytest under 74a for instance gives me:

JoyX(0) -> -1..1 okay
JoyY(0) -> -1..1 okay
JoyZ(0) -> JoyY(1) -1..1 def=-1 not okay
JoyX(1) -> JoyZ(1) 1..-1 def=1 not okay
JoyY(1) -> JoyX(1) -1..1 not okay
JoyZ(1) -> JoyZ(0) -1..1 not okay

Joy_X -> nada
Joy_Y -> nada
Joy_A -> JOY_DOWN
Joy_B -> nada
Joy_LB -> Joy_LEFT
Joy_RB -> Joy_RIGHT
Joy_LEFT ->Joy_X
Joy_RIGHT -> JoyY
Joy_UP -> Joy_A
Joy_DOWN -> Joy_B
Joy_START -> Joy_RB
Joy_BACK -> Joy_LB


Oddball(Posted 2013) [#2]
Here are the correct button mappings for MacOS.
http://www.monkeycoder.co.nz/Community/posts.php?topic=5137#56654

I have the corrected axis somewhere too. I'll look to dig them out.


taumel(Posted 2013) [#3]
This would be nice, thanks. With your mapping and 74a the buttons work on my Mac.

Would be nice if Mark could update this too.


computercoder(Posted 2013) [#4]
Have you tried 75d? Mark did quite a bit of work on controller issues within it. He even added a new constants JOY_LSB, JOY_RSB for Left Stick Button and Right Stick Button respectively. He even JOY_MENU for the OUYA controllers. I believe he added full support for multiple controllers per console that supports 4 controllers on them at a single time. So you should be able to play up to 4 players ina game at one time now.


taumel(Posted 2013) [#5]
Nope, i recently just stumbled back into monkey, due to a coding session/lesson, and due to earlier experiences i tried to stay away from the experimental releases. Oddball's mapping works fine for me, also for two Xbox 360 controllers. The only thing which is missing are all proper input axis. So, if he can dig them out, i'm happy and prepared for some more hours on the next weekend but thanks for the hint.


computercoder(Posted 2013) [#6]
Mark recently made 75d "stable" as 76a is the new Experimental, in case you were wanting a stable release :)

The newer code works far more efficiently than pre 75 versions by the way of controller support too. I can understand your hesitation tho. At any rate, at least download and try it out. You can always keep the version you have alongside another version.


Oddball(Posted 2013) [#7]
The button maps and axis are still borked in 75d. I'm assuming that Mark just used the same values for Mac as he did for windows without testing, and the tattiebogle driver uses different values on Mac.


taumel(Posted 2013) [#8]
Which again is the driver everyone uses i know. I doubt there exist many people who are compiling their own driver or utalising a tool like Controller Mate. It's nice that you can fix it in monkey on your own but a tool where the dev fixes known issues on his own is even better.


taumel(Posted 2013) [#9]
Back to monkey and regarding the proper axis (OS X, Xbox 360 controller) i did a grep on the joy stuff. In glfwgame.cpp you need to swap the mapping to:

joyx[0]=pos[0];joyx[1]=pos[2];
joyy[0]=pos[1];joyy[1]=pos[3];
joyz[0]=pos[4];joyz[1]=pos[5];

And then the controllers work as expected (+ Oddball's button mapping).