14th Apr, 2013, 08:03 AM
Hello.
First of all. This is the accessory I have. And I want to share my config. And you see how you have it configured.
I created a folder called xbox in /home/pi/ with the following contents:
loadxbox.sh -- Run chmod 777 loadxbox.sh
mapping2
Inside loadxbox.sh:
xboxdrv --config /home/xbian/xbox/mapping --silent &
Inside mapping:
This is how it works on my xbox controller. I could not make it work with keymaps. If you put your settings would help.
Thank you very much. And sorry for my English.
PD.: I do not add files in the post, will not let me.
First of all. This is the accessory I have. And I want to share my config. And you see how you have it configured.
I created a folder called xbox in /home/pi/ with the following contents:
loadxbox.sh -- Run chmod 777 loadxbox.sh
mapping2
Inside loadxbox.sh:
xboxdrv --config /home/xbian/xbox/mapping --silent &
Inside mapping:
Spoiler (Click to View)
# XBMC Configuration
# ==================
#
# This configuration file that with XBMC by emulating a wireless
# Xbox360 controller connected to the xpad kernel driver. It uses the
# configuration files that come with XBMC, so it should work out of
# the box without any further configuration of XBMC.
#
#
[xboxdrv]
ui-clear = true
extra-devices=false
extra-events=false
deadzone=6000
device-name = "Microsoft Xbox 360 Wireless Controller (PC)"
[ui-buttonmap]
A=KEY_K
B=KEY_L
X=KEY_J
Y=KEY_I
DU=KEY_UP
DD=KEY_DOWN
DL=KEY_LEFT
DR=KEY_RIGHT
START=KEY_O
GUIDE=KEY_M
BACK=KEY_U
RB=KEY_Y
LB=KEY_R
TL=KEY_S
TR=KEY_G
RT=KEY_E
LT=KEY_Q
[ui-axismap]
x1=KEY_A:KEY_D
x2=KEY_F:KEY_H
y1=KEY_W:KEY_X
y2=KEY_T:KEY_B
# The resp filter moves the neutral position to zero to work around a
# bug in XBMC, that causes bogus events when neutral position is
# elsewhere. It loses a bit of precision in the trigger as result, but
# that isn't noticable.
LT^resp:127:255=ABS_Z
RT^resp:127:255=ABS_RZ
# EOF #
Next Step modify rc.local:
nano /etc/rc.local
Above exit 0, paste: sh /home/pi/xbox/loadxbox.sh
Create a file named keyboard.xml and put in /usr/local/share/xbmc/system/keymaps:
<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not -->
<!-- used in the current window's section. Note that there is only handling -->
<!-- for a single action per button at this stage. -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox -->
<!-- gamepads. -->
<!-- The format is: -->
<!-- <device> -->
<!-- <button>action</button> -->
<!-- </device> -->
<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
<!-- <universalremote> -->
<!-- <obc45>Stop</obc45> -->
<!-- </universalremote> -->
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
<!-- Joysticks / Gamepads: -->
<!-- See the sample PS3 controller configuration below for the format. -->
<!-- -->
<!-- Joystick Name: -->
<!-- Do 'cat /proc/bus/input/devices' or see your xbmc log file to find the names of -->
<!-- detected joysticks. The name used in the configuration should match the detected name. -->
<!-- -->
<!-- Button Ids: -->
<!-- 'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear -->
<!-- in xbmc.log when they are pressed. Use your log to map custom buttons to actions. -->
<!-- -->
<!-- Axis Ids / Analog Controls -->
<!-- Coming soon. -->
<keymap>
<global>
<keyboard>
<k>Select</k>
<l>Back</l>
<j>FullScreen</j>
<i>Queue</i>
<r>ContextMenu</r>
<y/>
<o>XBMC.ActivateWindow(PlayerControls)</o>
<u>PreviousMenu</u>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<s>Screenshot</s>
<g>XBMC.ActivateWindow(ShutdownMenu)</g>
<q>ScrollUp</q>
<e>ScrollDown</e>
<f>AnalogSeekBack</f>
<h>AnalogSeekForward</h>
<t>VolumeUp</t>
<b>VolumeDown</b>
</keyboard>
</global>
<Home>
<keyboard>
<y>XBMC.Skin.ToggleSetting(HomeViewToggle)</y>
</keyboard>
</Home>
<MyFiles>
<keyboard>
<i>Highlight</i>
</keyboard>
</MyFiles>
<MyMusicPlaylist>
<keyboard>
<i>Delete</i>
<y>Back</y>
</keyboard>
</MyMusicPlaylist>
<MyMusicPlaylistEditor>
<keyboard>
<i>Queue</i>
</keyboard>
</MyMusicPlaylistEditor>
<MyMusicFiles>
<keyboard>
<i>Queue</i>
<y>Playlist</y>
</keyboard>
</MyMusicFiles>
<MyMusicLibrary>
<keyboard>
<i>Queue</i>
<y>Playlist</y>
</keyboard>
</MyMusicLibrary>
<FullscreenVideo>
<keyboard>
<k>Pause</k>
<l>Stop</l>
<i>AspectRatio</i>
<y>CodecInfo</y>
<r>Info</r>
<u>SmallStepBack</u>
<o>OSD</o>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
<left>StepBack</left>
<right>StepForward</right>
<up>BigStepForward</up>
<down>BigStepBack</down>
</keyboard>
</FullscreenVideo>
<FullscreenLiveTV>
<keyboard>
<left>PreviousChannelGroup</left>
<right>NextChannelGroup</right>
<up>ChannelUp</up>
<down>ChannelDown</down>
</keyboard>
</FullscreenLiveTV>
<FullscreenInfo>
<keyboard>
<o>OSD</o>
<y>CodecInfo</y>
<r>Back</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</FullscreenInfo>
<PlayerControls>
<keyboard>
<o>Back</o>
</keyboard>
</PlayerControls>
<Visualisation>
<keyboard>
<k>Pause</k>
<l>Stop</l>
<i>XBMC.ActivateWindow(VisualisationPresetList)</i>
<y>CodecInfo</y>
<r>Info</r>
<o>OSD</o>
<u>LockPreset</u>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
<left>SkipPrevious</left>
<right>SkipNext</right>
<up>NextPreset</up>
<down>PreviousPreset</down>
</keyboard>
</Visualisation>
<MusicOSD>
<keyboard>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</MusicOSD>
<VisualisationSettings>
<keyboard>
<o>Back</o>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VisualisationSettings>
<VisualisationPresetList>
<keyboard>
<o>Back</o>
<i>Back</i>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VisualisationPresetList>
<SlideShow>
<keyboard>
<k>Pause</k>
<l>Stop</l>
<i>Rotate</i>
<j>ZoomNormal</j>
<y>CodecInfo</y>
<r>Info</r>
<e>NextPicture</e>
<q>PreviousPicture</q>
<left>PreviousPicture</left>
<right>NextPicture</right>
<up>ZoomIn</up>
<down>ZoomOut</down>
<!--<leftthumbstick>AnalogMove</leftthumbstick>-->
<u>Stop</u>
</keyboard>
</SlideShow>
<ScreenCalibration>
<keyboard>
<!--<leftthumbstick>AnalogMove</leftthumbstick>-->
<k>NextCalibration</k>
<y>ResetCalibration</y>
<r>NextResolution</r>
</keyboard>
</ScreenCalibration>
<GUICalibration>
<keyboard>
<!--<leftthumbstick>AnalogMove</leftthumbstick>-->
<k>NextCalibration</k>
<y>ResetCalibration</y>
</keyboard>
</GUICalibration>
<VideoOSD>
<keyboard>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VideoOSD>
<VideoMenu>
<keyboard>
<i>AspectRatio</i>
<l>Stop</l>
<o>OSD</o>
<r>Info</r>
<y>CodecInfo</y>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VideoMenu>
<OSDVideoSettings>
<keyboard>
<j/>
<i>AspectRatio</i>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</OSDVideoSettings>
<OSDAudioSettings>
<keyboard>
<j/>
<i>AspectRatio</i>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</OSDAudioSettings>
<VideoBookmarks>
<keyboard>
<j/>
<i>Delete</i>
<o>Back</o>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VideoBookmarks>
<MyVideoLibrary>
<keyboard>
<y>Delete</y>
</keyboard>
</MyVideoLibrary>
<MyVideoFiles>
<keyboard>
<i>Queue</i>
<y>Playlist</y>
</keyboard>
</MyVideoFiles>
<MyVideoPlaylist>
<keyboard>
<i>Delete</i>
<y>Back</y>
</keyboard>
</MyVideoPlaylist>
<VirtualKeyboard>
<keyboard>
<o>Enter</o>
<l>BackSpace</l>
<i>Shift</i>
<j>Symbols</j>
<q>CursorLeft</q>
<e>CursorRight</e>
</keyboard>
</VirtualKeyboard>
<ContextMenu>
<keyboard>
<r>Back</r>
</keyboard>
</ContextMenu>
<Scripts>
<keyboard>
<y>info</y>
</keyboard>
</Scripts>
<NumericInput>
<keyboard>
<l>BackSpace</l>
<o>Enter</o>
<q>SkipPrevious</q>
<e>SkipNext</e>
</keyboard>
</NumericInput>
<GamepadInput>
<keyboard>
<o>Stop</o> <!-- Enter Password -->
</keyboard>
</GamepadInput>
<LockSettings>
<keyboard>
<o>Back</o>
</keyboard>
</LockSettings>
<ProfileSettings>
<keyboard>
<o>Back</o>
</keyboard>
</ProfileSettings>
<PictureInfo>
<keyboard>
<left>PreviousPicture</left>
<right>NextPicture</right>
</keyboard>
</PictureInfo>
</keymap>
# ==================
#
# This configuration file that with XBMC by emulating a wireless
# Xbox360 controller connected to the xpad kernel driver. It uses the
# configuration files that come with XBMC, so it should work out of
# the box without any further configuration of XBMC.
#
#
[xboxdrv]
ui-clear = true
extra-devices=false
extra-events=false
deadzone=6000
device-name = "Microsoft Xbox 360 Wireless Controller (PC)"
[ui-buttonmap]
A=KEY_K
B=KEY_L
X=KEY_J
Y=KEY_I
DU=KEY_UP
DD=KEY_DOWN
DL=KEY_LEFT
DR=KEY_RIGHT
START=KEY_O
GUIDE=KEY_M
BACK=KEY_U
RB=KEY_Y
LB=KEY_R
TL=KEY_S
TR=KEY_G
RT=KEY_E
LT=KEY_Q
[ui-axismap]
x1=KEY_A:KEY_D
x2=KEY_F:KEY_H
y1=KEY_W:KEY_X
y2=KEY_T:KEY_B
# The resp filter moves the neutral position to zero to work around a
# bug in XBMC, that causes bogus events when neutral position is
# elsewhere. It loses a bit of precision in the trigger as result, but
# that isn't noticable.
LT^resp:127:255=ABS_Z
RT^resp:127:255=ABS_RZ
# EOF #
Next Step modify rc.local:
nano /etc/rc.local
Above exit 0, paste: sh /home/pi/xbox/loadxbox.sh
Create a file named keyboard.xml and put in /usr/local/share/xbmc/system/keymaps:
<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not -->
<!-- used in the current window's section. Note that there is only handling -->
<!-- for a single action per button at this stage. -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox -->
<!-- gamepads. -->
<!-- The format is: -->
<!-- <device> -->
<!-- <button>action</button> -->
<!-- </device> -->
<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
<!-- <universalremote> -->
<!-- <obc45>Stop</obc45> -->
<!-- </universalremote> -->
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
<!-- Joysticks / Gamepads: -->
<!-- See the sample PS3 controller configuration below for the format. -->
<!-- -->
<!-- Joystick Name: -->
<!-- Do 'cat /proc/bus/input/devices' or see your xbmc log file to find the names of -->
<!-- detected joysticks. The name used in the configuration should match the detected name. -->
<!-- -->
<!-- Button Ids: -->
<!-- 'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear -->
<!-- in xbmc.log when they are pressed. Use your log to map custom buttons to actions. -->
<!-- -->
<!-- Axis Ids / Analog Controls -->
<!-- Coming soon. -->
<keymap>
<global>
<keyboard>
<k>Select</k>
<l>Back</l>
<j>FullScreen</j>
<i>Queue</i>
<r>ContextMenu</r>
<y/>
<o>XBMC.ActivateWindow(PlayerControls)</o>
<u>PreviousMenu</u>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<s>Screenshot</s>
<g>XBMC.ActivateWindow(ShutdownMenu)</g>
<q>ScrollUp</q>
<e>ScrollDown</e>
<f>AnalogSeekBack</f>
<h>AnalogSeekForward</h>
<t>VolumeUp</t>
<b>VolumeDown</b>
</keyboard>
</global>
<Home>
<keyboard>
<y>XBMC.Skin.ToggleSetting(HomeViewToggle)</y>
</keyboard>
</Home>
<MyFiles>
<keyboard>
<i>Highlight</i>
</keyboard>
</MyFiles>
<MyMusicPlaylist>
<keyboard>
<i>Delete</i>
<y>Back</y>
</keyboard>
</MyMusicPlaylist>
<MyMusicPlaylistEditor>
<keyboard>
<i>Queue</i>
</keyboard>
</MyMusicPlaylistEditor>
<MyMusicFiles>
<keyboard>
<i>Queue</i>
<y>Playlist</y>
</keyboard>
</MyMusicFiles>
<MyMusicLibrary>
<keyboard>
<i>Queue</i>
<y>Playlist</y>
</keyboard>
</MyMusicLibrary>
<FullscreenVideo>
<keyboard>
<k>Pause</k>
<l>Stop</l>
<i>AspectRatio</i>
<y>CodecInfo</y>
<r>Info</r>
<u>SmallStepBack</u>
<o>OSD</o>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
<left>StepBack</left>
<right>StepForward</right>
<up>BigStepForward</up>
<down>BigStepBack</down>
</keyboard>
</FullscreenVideo>
<FullscreenLiveTV>
<keyboard>
<left>PreviousChannelGroup</left>
<right>NextChannelGroup</right>
<up>ChannelUp</up>
<down>ChannelDown</down>
</keyboard>
</FullscreenLiveTV>
<FullscreenInfo>
<keyboard>
<o>OSD</o>
<y>CodecInfo</y>
<r>Back</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</FullscreenInfo>
<PlayerControls>
<keyboard>
<o>Back</o>
</keyboard>
</PlayerControls>
<Visualisation>
<keyboard>
<k>Pause</k>
<l>Stop</l>
<i>XBMC.ActivateWindow(VisualisationPresetList)</i>
<y>CodecInfo</y>
<r>Info</r>
<o>OSD</o>
<u>LockPreset</u>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
<left>SkipPrevious</left>
<right>SkipNext</right>
<up>NextPreset</up>
<down>PreviousPreset</down>
</keyboard>
</Visualisation>
<MusicOSD>
<keyboard>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</MusicOSD>
<VisualisationSettings>
<keyboard>
<o>Back</o>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VisualisationSettings>
<VisualisationPresetList>
<keyboard>
<o>Back</o>
<i>Back</i>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VisualisationPresetList>
<SlideShow>
<keyboard>
<k>Pause</k>
<l>Stop</l>
<i>Rotate</i>
<j>ZoomNormal</j>
<y>CodecInfo</y>
<r>Info</r>
<e>NextPicture</e>
<q>PreviousPicture</q>
<left>PreviousPicture</left>
<right>NextPicture</right>
<up>ZoomIn</up>
<down>ZoomOut</down>
<!--<leftthumbstick>AnalogMove</leftthumbstick>-->
<u>Stop</u>
</keyboard>
</SlideShow>
<ScreenCalibration>
<keyboard>
<!--<leftthumbstick>AnalogMove</leftthumbstick>-->
<k>NextCalibration</k>
<y>ResetCalibration</y>
<r>NextResolution</r>
</keyboard>
</ScreenCalibration>
<GUICalibration>
<keyboard>
<!--<leftthumbstick>AnalogMove</leftthumbstick>-->
<k>NextCalibration</k>
<y>ResetCalibration</y>
</keyboard>
</GUICalibration>
<VideoOSD>
<keyboard>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VideoOSD>
<VideoMenu>
<keyboard>
<i>AspectRatio</i>
<l>Stop</l>
<o>OSD</o>
<r>Info</r>
<y>CodecInfo</y>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VideoMenu>
<OSDVideoSettings>
<keyboard>
<j/>
<i>AspectRatio</i>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</OSDVideoSettings>
<OSDAudioSettings>
<keyboard>
<j/>
<i>AspectRatio</i>
<o>Back</o>
<y>CodecInfo</y>
<r>Info</r>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</OSDAudioSettings>
<VideoBookmarks>
<keyboard>
<j/>
<i>Delete</i>
<o>Back</o>
<q>AnalogRewind</q>
<e>AnalogFastForward</e>
</keyboard>
</VideoBookmarks>
<MyVideoLibrary>
<keyboard>
<y>Delete</y>
</keyboard>
</MyVideoLibrary>
<MyVideoFiles>
<keyboard>
<i>Queue</i>
<y>Playlist</y>
</keyboard>
</MyVideoFiles>
<MyVideoPlaylist>
<keyboard>
<i>Delete</i>
<y>Back</y>
</keyboard>
</MyVideoPlaylist>
<VirtualKeyboard>
<keyboard>
<o>Enter</o>
<l>BackSpace</l>
<i>Shift</i>
<j>Symbols</j>
<q>CursorLeft</q>
<e>CursorRight</e>
</keyboard>
</VirtualKeyboard>
<ContextMenu>
<keyboard>
<r>Back</r>
</keyboard>
</ContextMenu>
<Scripts>
<keyboard>
<y>info</y>
</keyboard>
</Scripts>
<NumericInput>
<keyboard>
<l>BackSpace</l>
<o>Enter</o>
<q>SkipPrevious</q>
<e>SkipNext</e>
</keyboard>
</NumericInput>
<GamepadInput>
<keyboard>
<o>Stop</o> <!-- Enter Password -->
</keyboard>
</GamepadInput>
<LockSettings>
<keyboard>
<o>Back</o>
</keyboard>
</LockSettings>
<ProfileSettings>
<keyboard>
<o>Back</o>
</keyboard>
</ProfileSettings>
<PictureInfo>
<keyboard>
<left>PreviousPicture</left>
<right>NextPicture</right>
</keyboard>
</PictureInfo>
</keymap>
Thank you very much. And sorry for my English.
PD.: I do not add files in the post, will not let me.