Interestingly enough, I've been working on basically exactly the same project, and I too had a bit of trouble with this. You
can map the joystick axis in keymap.xml, but XBMC doesn't handle repeat delay with joystick axis, so one press on any direction gives 5-20 movements.
My solution after browsing the forums for a while was to use jhat --
http://hans.fugal.net/blog/2007/06/02/jo...-in-linux/ Although any other "joystick button/axis to keyboard press" utility would work. I set up my box to automatically run the command:
Code:
jhat /dev/input/js1 0 1
on startup. (Replace /dev/input/js1 with whever your joystick shows up). And that's it! The joystick buttons are mapped to key presses. If you want to change the behavior of a button in XBMC, use the <keyboard> tag, instead of <joystick>
Just for reference, since I'm doing an almost identical project, here's my keymap.xml:
Code:
<keymap>
<global>
<joystick name="RetroUSB.com RetroPad">
<button id="1">PreviousMenu</button>
<button id="2">Select</button>
<button id="3">ContextMenu</button>
<button id="4">ActivateWindow(shutdownmenu)</button>
</joystick>
</global>
<FullscreenVideo>
<keyboard>
<up>OSD</up>
<down>Info</down>
<left>Rewind</left>
<right>FastForward</right>
</keyboard>
<joystick name="RetroUSB.com RetroPad">
<button id="3">ShowSubtitles</button>
<button id="1">Fullscreen</button>
<button id="2">Pause</button>
</joystick>
</FullscreenVideo>
<VideoOSD>
<joystick name="RetroUSB.com RetroPad">
<button id="1">Close</button>
</joystick>
</VideoOSD>
<Visualisation>
<keyboard>
<up>ActivateWindow(MusicOSD)</up>
<down>Info</down>
</keyboard>
<joystick name="RetroUSB.com RetroPad">
<button id="2">Pause</button>
<button id="1">FullScreen</button>
<button id="3">CodecInfo</button>
</joystick>
</Visualisation>
<Home>
<joystick name="RetroUSB.com RetroPad">
<button id="1">FullScreen</button>
</joystick>
</Home>
<VirtualKeyboard>
<joystick name="RetroUSB.com RetroPad">
<button id="3">Shift</button>
</joystick>
</VirtualKeyboard>
</keymap>
Does exactly what I want it to
But... you might want some tweaking if you don't have my random taste for button configurations