Skip to main content
Participating Frequently
June 26, 2013
Answered

OUYA controller support

  • June 26, 2013
  • 1 reply
  • 9433 views

Hello,

I'm using the GameInput class on OUYA to use the controllers. When calling GameInput.numDevices, I get 1 (for the controller I have connected), but when asking GameInput.getDeviceAt(0), I get a null.

I've tried with AIR 3.7 and 3.8 beta. Is there anything I can do to fix this?

Thank you in advance!

This topic has been closed for replies.
Correct answer Damanjit Singh

Could you please share your code. Could it be that the GameInput object is goiing out of scope and garbage collected?

1 reply

Adobe Employee
June 26, 2013

Hello,

GameInput.getDeviceAt(0) is working very fine. Please find the .apk and a sample project attached in the below link:

https://www.dropbox.com/sh/0e4tef1wh1zdhlj/xozQLrNJJE

Please try it and share your result. Also, please use -swf-version>=20(if not using) while using GameInput API's.

Regards,

Nimit

ArcnorAuthor
Participating Frequently
June 26, 2013

Hello nimitja, and thanks for your fast response

Your sample worked on the third try for some reason (black screen before that). After that, I got a white screen with text. Looking at your code, I see that the text gets populated on the GameInputEvent.DEVICE_ADDED listener. For some reason, that listener never gets called in my code, although querying GameInput still returns numDevices == 1.

I aded the "-swf-version=20" to the compiler, but nothing changed.

I'll try recompiling your project to see if it's some kind of environment problem, as I don't know what else to check.

Thank you!

Damanjit SinghCorrect answer
Adobe Employee
June 26, 2013

Could you please share your code. Could it be that the GameInput object is goiing out of scope and garbage collected?