Skip to main content
Participating Frequently
Jun 26, 2013 11:04 AM UTC
Answered

OUYA controller support

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 is closed to new replies. Start a new post to keep the conversation going.
Damanjit SinghCorrect answer
Adobe Employee
Jun 26, 2013 3:46 PM UTC

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

31 replies

Adobe Employee
Jun 26, 2013 12:09 PM UTC

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

Translate
ArcnorAuthor
Participating Frequently
Jun 26, 2013 12:28 PM UTC

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!

Translate
Damanjit SinghCorrect answer
Adobe Employee
Jun 26, 2013 3:46 PM UTC

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

Translate