[Windows]Setup XBox Controller with keymap.xml
#1
After a little bit of struggling and information gathering, I finally figured out how to use the "keymap.xml" to use my Xbox 360-Controller without the need of an event-client.

Important
If your controller does not work or/and you are using XBCD for your controller, you have to check the correct button-assignments which are used by SDL.
Start XBMC, enable debug-logging, and press the buttons you want to use. Remember the order and consult your debug.log, the button-presses should be shown in there.

The Button-Layout is the following:
Code:
Button id 1 = A
Button id 2 = B
Button id 3 = X
Button id 4 = Y
Button id 5 = Left Shoulder Button
Button id 6 = Right Shoulder Button
Button id 7 = back
Button id 8 = start
Button id 9 = left stick button
Button id 10 = right stick button

axis limit="-1" id="1"   Left on left stick
axis limit="+1" id="1"   Right on left stick
axis limit="-1" id="2"   Up on left stick
axis limit="+1" id="2"   Down on left stick

axis limit="-1" id="3"   LeftTrigger
axis limit="+1" id="3"   RightTrigger

axis limit="-1" id="4"   Up on right stick
axis limit="+1" id="4"   Down on right stick
axis limit="-1" id="5"   Left on right stick
axis limit="+1" id="5"   Right on right stick

hat id="1" position="up"   Up on DPAD
hat id="1" position="right"   Right on DPAD
hat id="1" position="down"   Down on DPAD
hat id="1" position="left"   Left on DPAD

Simple steps to create your own keymap.xml:
1. Navigate to xbmc_root/system/keymaps

2. Use either an existing XML-File for editing (I would suggest "joystick.Microsoft.Xbox.360.Controller.xml") or create a new one

3. Navigate to XBMC's Data-Folder* and open the logfile "xbmc"

4. If your controller was connected the last time you ran XBMC, you will see an entry that reads like
Code:
NOTICE: Enabled Joystick: XBOX 360 For Windows (Controller)
NOTICE: Details: Total Axis: 5 Total Hats: 1 Total Buttons: 10
Use the line which is right behinde "Enabled Joystick" for the name of the joystick.

5. Create/Change the nodes for your needs. Check the Wiki for Instructions (more below).

6. Done, you should be up and running! (Note: You must restart the XBMC in order to apply the changes you made)

* = mostly "C:\Users\YourName\AppData\Roaming\XBMC" - note that the folder "AppData" is hidden


Good to know:
Here is a list of actions you can use:
http://wiki.xbmc.org/index.php?title=Keymap.xml#Actions

The full list of actions is here:
http://xbmc.svn.sourceforge.net/viewvc/x...iew=markup

Look at the part below "static const ActionMapping actions[] =" .
On the left side you find the name to use for the action, on the right side the action which is executed.

You can also run XBMC's internal commands, just put "XBMC." before function (XBMC.Function). A list of commands is here:
http://wiki.xbmc.org/index.php?title=Lis..._Functions

And a list of available windows:
http://wiki.xbmc.org/index.php?title=Window_IDs


Example:
You can find my example key-file with mappings here:
http://pastebin.com/ZiNyYEZV
Reply
#2
This was super helpful, thanks!
Reply
#3
No problem, glad I could help.

@Mod: I would like to see this thread in the "How-To"-Section as it might helpt others to find their way around.
Reply
#4
Is it possible to use a wired xbox360 controller to control xbmc on a dual monitor windows setup?
Reply
#5
@agentbad: Yeah, of course - why wouldn't it be? As long as the xbmc is in focus, the keymap.xml as demonstratet above will work.

If you want to use the controller for the xbmc even without the xbmc being in the focus (= being the active window), you can use the EventClient for the Xbox-Controller which would exactly do what you want.
Reply
#6
This fixes the problem i had. should be implemented in the official xbmc. current included keymap in xbmc is problematic.

Thanks.
Reply
#7
publicENEMY Wrote:This fixes the problem i had. should be implemented in the official xbmc. current included keymap in xbmc is problematic.
This again is also problematic due to the different naming of the device. I just tested it with a friend and my laptop:
On every single machine the name for the controller does not match, they are different every time.

For instance my wireless controller:
1. On my Laptop it was named "Controller (Xbox wireless receiver for windows)"
2. On my PC it was named "Xbox wireless receiver for windows (Controller)"
3. On the PC of my friend it was named "Xbox Receiver for Windows (Wireless Controller)"
Reply
#8
I was using the EventClient before, and I like this better since I can customize my keys. But there was one thing that worked really well with the EventClient and I dont know why that's changed.

The triggers used to toggle fastforward and rewind between different speeds. I tried to use the keymap to do the same, but it's too sensitive. At the slightest touch, it jumps to 32x. Back with the event client, it required several presses of the trigger to jump to that speed. Any idea why?

thanks
Reply
#9
This is brilliant I've been wondering why the bloody pad didn;t work for about 2 weeks now.

Still can't the damned thing to work mind you, I'll be playing with it for a while longer now though!
Reply
#10
pathw Wrote:The triggers used to toggle fastforward and rewind between different speeds. I tried to use the keymap to do the same, but it's too sensitive. At the slightest touch, it jumps to 32x. Back with the event client, it required several presses of the trigger to jump to that speed. Any idea why?
I cannot come up with an idea why it is behaving that way. I use the triggers for analog-ff/fr too, but the 32x is only triggered when I hold the trigger down completely, I can quite accuratly switch between 2x/4x/8x/16x/32x with the triggers.
I simply have no idea why it is behaving that way on your end...can you post your keymap-xml? Maybe it is an issue inside of it, I could check it out.

@Rodimus: You say it doesn't work yet. I am willing to help - can you provide more information on your pad? Do you use a wired or wireless? Original MS Xbox-Controller?
Reply
#11
oh do you mean that to trigger a certain speed depends on how much I press down on the trigger? The eventclient worked differently in that pressing it would make it jump to the next speed and elongated press would make it start to jump speeds. It was like discrete button presses but with long press being like multiple presses.

Let me try playing around with the sensitivity. But the previous system was easily predictable. (I understand that triggers are modelled as analog and not buttons, so that may not be trivial)
Reply
#12
It depends... you have to replace the mapping "AnalogFastForward" with "FastForward", then it should work like you want to.
Reply
#13
Thanks mate, my wired 360 controller now workis in XBMC. Big Grin
Reply
#14
My wireless controller nog working correct.

The buttons on the left side are working (up,down, left and right) but the joystick left is nog working.
Reply
#15
can you post your keymap? I could check it then...
(you can use pastebin.org to post the keymap)
Need help? Check out my XBMC Frodo Guide. It contains full featured guides to Sickbeard and CouchPotato as well.

Image
Reply

Logout Mark Read Team Forum Stats Members Help
[Windows]Setup XBox Controller with keymap.xml1