Joystick Axis in keymap....
#1
I've been building an XBMC box into an NES, and one of my goals has been to have NES controllers work with it. I spent some time working on a keymap file, but when I received my NES -> USB adapters I discovered that the adapters send D-PAD presses as axis values instead of button presses. I have yet to be able to get XBMC to recognize the d-pad, but jstest seems to see it. Is joystick axis support planned for Dharma at all at this point?
Subtitles - Serious Business
Reply
#2
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 Smile But... you might want some tweaking if you don't have my random taste for button configurations Smile
Reply
#3
Thank you. I think that this is probably exactly what I need.

I'll make sure to post pictures when my project is done. I can't believe I've shoved two hard drives and a DVD burner in it already.

EDIT: My other side to this is to reskin PM3 to look a bit more 8-bit.
Subtitles - Serious Business
Reply
#4
Woot. Got it working. Adjusted the apple remote keymap so that I had full control. The only thing I seem to be missing is keyboard directional response when trying to enter text, but I bet that was pulled at some point to encourage the use of the actual keyboard to type.
Subtitles - Serious Business
Reply
#5
If you choose "my remote acts like a keyboard" it should work.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
jmarshall Wrote:If you choose "my remote acts like a keyboard" it should work.

There we go. That's the last thing except for some fine tuning. I will need to find a way to get XBMC to fork jhat (I think it has to be done in X - and I'm running live - but I get away with launching xfce and then starting jhat and then starting xbmc for now). I need to dig through some scripts to get to that point, but that shouldn't be too hard. Once I get to that point I'll make a post describing how to set it up and I'll include a keymap. When XBMC supports axes, I'll rewrite the keymap and submit it as for inclusion.
Subtitles - Serious Business
Reply

Logout Mark Read Team Forum Stats Members Help
Joystick Axis in keymap....0