Controller codes for Moto Mods gamepad

Anything about development not directly related to libgdx, e.g. OpenGL, Android APIs etc.

Controller codes for Moto Mods gamepad

Postby Magnesus » Thu Apr 26, 2018 10:41 am

Maybe someone will find it useful, the Moto Mods gamepad controller codes:

NAME: STMicroelectronics Lenovo GamePad
SELECT: 109
START: 108
X 99
Y 100
A 96
B 97
L1 102
L2 104
R1 103
R2 105
LEFT STICK: axis 0 (lr), 1 (ud)
DPAD: axis 6 (lr),7 (ud)
RIGHT STICK: axis 2(lr) 3 (ud)
All axises are -1 for left and up, +1 for right and down.
Magnesus
 
Posts: 1632
Joined: Sun Sep 25, 2011 3:50 pm

Re: Controller codes for Moto Mods gamepad

Postby EtherSecAgent » Wed Aug 01, 2018 8:47 pm

Hi I signed up on this forum to ask you this question,

Did you find this info from a .kl file ? ( Keyboard Layout )

I've been trying to locate this file on my device,for this Gamepad, can you please tell me the location
EtherSecAgent
 
Posts: 1
Joined: Wed Aug 01, 2018 8:44 pm

Re: Controller codes for Moto Mods gamepad

Postby MrStahlfelge » Thu Aug 02, 2018 6:47 pm

It is from the Android constants listed here: https://developer.android.com/training/ ... ller-input
MrStahlfelge
 
Posts: 93
Joined: Thu Jun 15, 2017 6:40 am

Re: Controller codes for Moto Mods gamepad

Postby Magnesus » Fri Aug 03, 2018 3:54 pm

Actually I measured them since I have the mod, but they probably match the Android specification. :mrgreen: (By the way the mod itself hurts my hands after a while, so I can't recommend it. Nice idea, badly realised.)

Here is my game running with it: https://twitter.com/MagoryNET/status/989441181984714752
Magnesus
 
Posts: 1632
Joined: Sun Sep 25, 2011 3:50 pm

Re: Controller codes for Moto Mods gamepad

Postby MrStahlfelge » Sat Aug 04, 2018 8:45 am

All gamepads I tried on Android match this specification. It would be a shame if an Android-only controller would not.

It is sad that gdx-controllers extension doesn't convert these Android button and axis code to the typical desktop and web browser ones as libGDX core does with keyboard keycode, but adding this now would break downwards compatiblity. So everyone has to use https://github.com/MrStahlfelge/gdx-controllerutils/wiki/Configurable-Game-Controller-Mappings. I recommend you to use it, and, oh, it's made by me. :mrgreen: Try it in my game if you want: https://play.google.com/store/apps/details?id=de.golfgl.lightblocks
Nice picture of your game!
MrStahlfelge
 
Posts: 93
Joined: Thu Jun 15, 2017 6:40 am


Return to General Development

Who is online

Users browsing this forum: No registered users and 1 guest