Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Adding Xperia play gamepad support to your games

Daniel TGC
Retired Moderator
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 5th Jan 2012 20:31 Edited at: 5th Jan 2012 20:34
Hi guys,

I've got an Xperia play which comes with that nice built in gamepad, so the first question I asked was how to I use it in my games!

The good news is that I have some of the buttons working. Not all of them, but here's what I've worked out so far.

The D-Pad codes are:

Up key = 39
Down key = 37
Right key = 40
Left key = 38

On the right playstation buttons I could only get the circle key to work.

Circle = 27

Non-functional buttons:

Triangle, Square, X, Select and Start and menu.

This is tested using:

While there isn't full support, this partial support may be handy if you're producing a simple shooter, space invaders game or whatever. If anyone knows away of getting the other buttons to work that I'm not aware of yet please let us all know!

I have also tried to get some kind of mouse or joystick input from the two analog virtual sticks which unsurprisingly yielded no results. But again if anyone knows a way of getting this to work please let us all know, again!
The Zoq2
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 5th Jan 2012 21:57
Quote: "Circle = 27"

That's the same as the back key on my Android

Login to post a reply

Server time is: 2023-12-01 03:39:24
Your offset time is: 2023-12-01 03:39:24