Kodi Community Forum

Full Version: keymap.xml - axes problem with right analog stick
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I've been using XBMC for quite some time now, but just recently got interested into customizing it more.
So, I have a PlayStation 2 controller connected to my PC via an USB converter and wanted to map the keys so that I could use the controller for XBMC. Under Control Panel > Gamecontroller > Twin USB Vibration Gamepad > Properties it shows twelve buttons and four axes (X, Y, Rz, and Z). In the code below, I labeled the "image" with id numbers of the keys and axes from the Windows properties.

Everything seems to work fine except the right analog stick, which has the Rz and Z axes. I want to assign the volume control to the right analog stick: Left for VolumeDown and Right for VolumeUp. But with id="3" it's up and down for the volume (even though in Windows "3" is for Rz axis). So then I tried it with id="4" but nothing at all happened.

Does anyone have an idea what the problem is? Thanks for any help!

Code:
<!-- PS2-Controller                        -->
<!-- (Twin USB Vibration Gamepad)        -->
<!--    Buttons:                        -->
<!--                                    -->
<!--     / _5__  \         / __6_  \    -->
<!--     |  7    |_________|   8   |    -->
<!--     /                          \    -->
<!--    //   |     9      10  / 1   \\    -->
<!--   ||  -=X=-  ___    ___  4   2 ||    -->
<!--   \\    |   / _ \  / _ \   3  //    -->
<!--    \        ||_||  ||_||       /    -->
<!--     |       \___/  \___/       |    -->
<!--     |       | 11    12 |       |    -->
<!--     \      /           \       /    -->
<!--      \____/             \_____/    -->
<!--                                    -->
<!--    Axes:                            -->
<!--    Left Analog Stick                -->
<!--        X-Axis (1): -L +R            -->        
<!--        Y-Axis (2): -U +D            -->
<!--    Right Analog Stick                -->
<!--        Rz-Axis(3): -L +R            -->
<!--        Z-Axis (4): -U +D            -->


<keymap>
    <global>
        <joystick name="Twin USB Vibration Gamepad">
            <hat id="1" position="up">Up</hat>
            <hat id="1" position="down">Down</hat>
            <hat id="1" position="left">Left</hat>
            <hat id="1" position="right">Right</hat>
            <button id="2">Back</button>
            <button id="3">Select</button>
            <button id="6">FULLSCREEN</button>
            <button id="4">ContextMenu</button>
            <axis id="2" limit="-1">ScrollUp</axis>
            <axis id="2" limit="+1">ScrollDown</axis>
            <axis id="3" limit="-1">VolumeUp</axis>
            <axis id="3" limit="+1">VolumeDown</axis>
            <button id="12">Mute</button>
         </joystick>
    </global>

    <FullscreenVideo>
        <joystick name="Twin USB Vibration Gamepad">    
            <hat id="1" position="up">BigStepForward</hat>
            <hat id="1" position="down">BigStepBack</hat>
            <hat id="1" position="left">StepBack</hat>
            <hat id="1" position="right">StepForward</hat>
            <axis id="1" limit="-1">AnalogSeekBack</axis>
            <axis id="1" limit="+1">AnalogSeekForward</axis>
            <button id="3">OSD</button>
            <button id="7">Rewind</button>
            <button id="8">FastForward</button>
        </joystick>
    </FullscreenVideo>

</keymap>