Joystick on Android...?

Monkey Targets Forums/Android/Joystick on Android...?

SLotman(Posted 2014) [#1]
What I'm doing wrong? The code below does nothing for me:
I'm using Monkey 77f - targetSDK on manifest = 12, with BlueStacks Emulator and Xbox 360 joystick (which works on BlueStacks, I can even play Flappy Bird with it.)




SLotman(Posted 2014) [#2]
Moving parts of the code into OnUpdate, also made no difference:



SLotman(Posted 2015) [#3]
And after all this time, I'm still stuck - now trying on a real android device, with the XBOX360 controller connected and recognized by the system, and I can't read anything of it from Monkey :(

Even managed to make Monkey 0.80b to compile to the new target, and still - nothing.

Have anyone managed to get joysticks working under android?


SLotman(Posted 2015) [#4]
Just found out that JoyX() and JoyY() are returning values...! but JoyDown(JOY_UP/_DOWN/_LEFT/_RIGHT), or any JoyHit (even for buttons!) returns nothing.

JoyDown(Button) does return correctly.


Sensei(Posted 2015) [#5]
Slotman, I've just been playing with joystick support for my android game too.
I have numerous sticks and my findings thus far:

Ouya controller: Most buttons work but you'll need to remap some to match any other platforms.
Amazon Fire TV controller: All works perfectly.

Wired usb controllers:
Xbox 360/PS3(DS3 and sixaxis)
All buttons and mappings work perfectly.

Caveats:
1. No dpads work on any controller apart from the PS3 joypad. I suspect the code isn't yet implemented in Monkey-X? All joypad dpads work perfectly fine on the android desktop as such.
2. Wired USB controllers work as stated above, but they need to go via a powered USB device. Without it, they're dead as a doornail.

I use the standard JoyDown() commands for the above and obviously also JoyY() and JoyX() for analog inputs.

For an easy test, I compiled joytest.monkey to Android to do the above tests and then made notes of what buttons or values they return. I've only listed what actually works.
ouya:
up:joyY(0) < 0
down:joyY(0) > 0
left:joyX(0) < 0
right:joyX(0) > 0
left trigger: joyX(1) < 1
right trigger: joyY(1) < 1
joy_y (LB)
joy_a (O)
joy_x (A)
joy_b (U)
joy_LB: (left thumbstick press)
joy_RB: (right thumbstick press)
start: joy_start (dpad right)

firetv:
up:joyY(0) < 0
down:joyY(0) > 0
left:joyX(0) < 0
right:joyX(0) > 0
up:joyY(1) < 0
down:joyY(1) > 0
left:joyX(1) < 0
right:joyX(1) > 0
joy_a (A)
joy_b (B)
joy_x (X)
joy_y (Y)
joy_RB (RB)
joy_LB (LB)
start:joy_start (right button menu key)

xbox360/PS3:
up:joyY(0) < 0
down:joyY(0) > 0
left:joyX(0) < 0
right:joyX(0) > 0
up:joyY(1) < 0
down:joyY(1) > 0
left:joyX(1) < 0
right:joyX(1) > 0
joy_a (A)/(cross)
joy_b (B)/(circle)
joy_y (Y)/(triangle)
joy_x (X)/(square)
joy_RB (RB)/(R1)
joy_LB (LB)/(L1)
joyZ(0) (LT)/(L2)
joyZ(1) (RT)/(R2)
start:joy_start (start button)


Hope this helps.

Has anybody else managed to get dpads working on android?