koying / SPMC

fork of xbmc/kodi
Other
632 stars 257 forks source link

Key bindings for Shield TV controller #255

Open bennyhillthebest opened 8 years ago

bennyhillthebest commented 8 years ago

Hi, i would like to remap the shield controller buttons to match their configuration with the Kodi app (X shows the OSD buttons and Y shows the playlist while the video keeps playing in the background), but i am not able to do it. The keymap addon doesn't seems to understand the controller inputs and i have not found XMLs of the bindings for SPMC and Kodi. What do i have to do?

filigran commented 8 years ago

Ony my rooted Shield, there is a file in

/data/data/com.semperpax.spmc16/cache/apk/assets/system/keymaps

called

joystick.xml

(also here: github:koying/SPMC joystick.xml.sample)

This one controls the buttons. Copy that to

/sdcard/Android/data/com.semperpax.spmc16/files/.spmc/userdata/keymaps

(or wherever your .spmc files are, in case you changed it with spmc_env.properties) and edit.

The file has comments as to what buttons are which. I have my controller in a Fed Ex box on it's way to Nvidia in the NL to be replaced (back and home button not working) so can't test right now, but IIRC I used http://html5gamepad.com/ to test the gamepad buttons and which is which. Might have to connect it to a PC to try, haven't tested through Chrome on the shield itself. There are apps to do it too I suppose.

An alternative to testing what button is which is to edit the file so that each button prints a notification: <button id="1">Notification(button pressed,1)</button> or whatever, and repeat for all buttons.

Also, you might have to change line 35 to read <joystick name="NVIDIA Corporation NVIDIA Controller v01.03"> but I don't think so.. to double check the name, search the log for Controller.

Like I said, can't test it myself atm. :)

piatikantrop commented 8 years ago

did this work? any update?

ghost commented 8 years ago

I couldn't get any of these action IDs to work?

joystick.xml.txt

filigran commented 8 years ago

I have placed my joystick.xml in /storage/emulated/0/Android/data/com.semperpax.spmc16/files/.spmc/userdata/keymaps and it works for me, for the most part.

A few of the buttons I cannot get to work, same as @neobithia .

They do work using html5gamepad.com, but not in kodi/SPMC. Nor do they work using KeyTest.apk (http://forum.xda-developers.com/showpost.php?p=65087537&postcount=24). Since html5gamepad.com (and a few other gamepad testers I found on the play store) has them working, it's not the remote. Must be SPMC failing to register them for some reason. @koying - any thoughts?

It seems back can be changed - but it is seen as a keyboard event, so needs to be changed in keyboard.xml instead of joystick.xml.

Start I cannot get to show a notification on Home, but in FullscreenVideo it can be changed. Odd?

The triggers on top (L2/R2) seem to do nothing, and should probably be axis 3 +1/-1. Like I said, they do work while testing at html5gamepad.com, so not a hardware issue.

I uploaded an image here: http://i.imgur.com/CcZ404H.jpg that shows my findings.

ghost commented 8 years ago

I reinstalled SPMC and got most of them working.

I don't think the name of the xml file matters. It's the tags.

But, I split mine into 3 xml files just to help keep things organized:

joystick.xml.txt keyboard.xml.txt remote.xml.txt

beschoenen commented 8 years ago

@neobithia Why does your remote.xml.txt say:

<!-- Do not enable longpress for Back -->
<key id="61448" mod="longpress"></key>

I want to show the powermenu on longpress back, is that possible?

ghost commented 8 years ago

This was a while ago. I think because long press on certain buttons on the remote didn't work?

ghost commented 8 years ago

Crap, maybe it didn't work because there is a type o in it!

ghost commented 8 years ago

Wait there's no type o

DuckersMcQuack commented 7 years ago

Filigran, can the touchpad on the shied tv be used to map the touch and swipe gestures to buttons with those?