Kodi Community Forum

Full Version: NVIDIA Shield/Game pad navigation support.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to navgate using the D-pad ? Is editing keyboard.xml a solution.
I think it depends on if XBMC can see game controllers in Android, and how Nvidia's controller is presented. In other words, it's really hard to say without having one. There are various work-arounds to make a controller do something that XBMC can see, like emulating keyboard input. It's been a while since I've played around with controllers and Android, so hopefully someone else can add to this.
keytest.apk will give you the keycodes used by the Shield gamepad which you can feed into a keyboard.xml if you have the patience to do all of that.
I just tried doing that, put the keyboard.xml in the userdata folder but it still won't accept the Shield controller. This is what I have in the XML file, the codes are the ones I got using the keytest.apk. It is important to note that some buttons like A and B work without the need to create an XML file, so I honestly don't know why the others don't.

<global>
<keymap>
<joystick name="Nvidia Shield">
<button id="107">Info</button> <!-- Right Thumb -->
<button id="103">ContextMenu</button> <!-- RB -->
<button id="106">CodecInfo</button> <!-- Left Thumb -->
<button id="99">Play</button> <!-- X -->
<button id="19">Up</button> <!-- D-Pad Up -->
<button id="22">Right</button> <!-- D-Pad Right -->
<button id="20">Down</button> <!-- D-Pad Down -->
<button id="21">Left</button> <!-- D-Pad Left -->
<button id="100">Stop</button> <!-- Y -->
<button id="102">OSD</button> <!-- LB -->
</joystick>
</keymap>
</global>

Whatever method that was used to map the Ouya controller should work with the shield in theory shouldn't it?
So I think the shield supports many of the standard android controller interfaces. It works with some games which are not targeted to it. I think one issue is it defaults to be "normal" buttons and a mouse style interfaces if it is not spoken to as a game pad. That is why A and B work as they are acting as "yes" and "Back". Perhaps I will try the above aproach with the "virtul mouse" feature disabled.

Anyone have any tricks for convinsing me the map file has been read. Ie customising the behavoir of somthing else?
Well I thought I should let you know just in case you misunderstood my post, the above method does not work. Mapping everything manually does not allow XBMC on android to detect the input.
FYI, as of this PR git:master should have support for the gamepad on SHIELD (plus other devices!):

https://github.com/xbmc/xbmc/pull/3536
Thanks for the update! Finally time to rock the shield as a portable xbmc media player lol
I'm using the SixAxis app in gamepad emulation mode, which works for games and the Android UI, but it doesn't seem to work in XBMC. A couple of the buttons trigger events, but the D-Pad and sticks don't do anything. I'm going back to mouse emulation mode for now, but would really like to have controller support.

I'm currently running XBMC 13.0-ALPHA10 Git:20131110-c0726e3 which I think should include the gamepad controller support, from that pull request?

Is there anything that needs to added to a default nightly install to get this functionality?
Could you post a log where you try to use the sticks/dpads, please.
Hi Koying, thanks for taking a look at this.

I've uploaded the log at http://xbmclogs.com/show.php?id=85243

After loading xbmc and waiting for the log to settle, I did left, right, up down first on the D-Pad, then the left stick, then the right stick.

The only visible action in the UI appeared to be on the right stick, where left increased the volume and right decreased the volume

In the android UI, I can use the D-Pad for navigation, and I've used the sticks with various Android games as well.

Edit: The right stick doesn't control any of the Android volume controls outside of xbmc.
Problem seem to be that the "standard" PS3 keymap shipped with XBMC is not compatible with android.

Could you try by putting this: joystick.Sony.PLAYSTATION®3.Controller.android.xml, http://filez.semperpax.com/ab8ylfvl
into
Code:
/sdcard/Android/data/org.xbmc.xbmc/files/.xbmc/userdata/keymaps/
Thank you, that did the job nicely!
I've committed a permanent fix for this.