Keymap: Difference between revisions
>Jim no.6 (Added PlayDVD based on forum thread) |
>Diver864 mNo edit summary |
||
Line 2: | Line 2: | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
__NOTOC__ | __NOTOC__ | ||
keymap.xml (renamed to keyboard.xml in v9.11 and later) defines the mappings of | keymap.xml (renamed to keyboard.xml in v9.11 and later but not yet for Xbox-based releases) defines the mappings of keys to XBMC actions. You can redefine all keys of the remote and keyboard and all buttons on the gamepad as you like by editing the keymapping. | ||
keys to XBMC actions. | |||
You can redefine all keys of the remote and keyboard and all buttons on the gamepad as you like by editing the keymapping. | |||
From version 9.11 onwards there is a system keymapping in the | From version 9.11 onwards there is a system keymapping in the | ||
[http://trac.xbmc.org/browser/trunk/system/keymaps system/keymaps/] subfolder of your installation. | [http://trac.xbmc.org/browser/trunk/system/keymaps system/keymaps/] subfolder of your installation. | ||
This keymapping applies to all users. | This keymapping applies to all users. In Xbox releases this is /Dashboard/system/Keymap.xml. | ||
In addition to the system keymap you can create another keyboard.xml file in your userdata/keymaps/ | In addition to the system keymap you can create another keyboard.xml file in your userdata/keymaps/ | ||
folder. Any mappings you define add to or override mappings in the system keymap. | folder. Any mappings you define add to or override mappings in the system keymap. In Xbox releases this does not apply (at present, based on T3CH SVN releases.) | ||
If you use Linux then your userdata folder is $home/.xbmc/userdata so the full path to your keyboard.xml file is $home/.xbmc/userdata/keymaps/keyboard.xml. | If you use Linux then your userdata folder is $home/.xbmc/userdata so the full path to your keyboard.xml file is $home/.xbmc/userdata/keymaps/keyboard.xml. |
Revision as of 14:45, 28 January 2010
keymap.xml (renamed to keyboard.xml in v9.11 and later but not yet for Xbox-based releases) defines the mappings of keys to XBMC actions. You can redefine all keys of the remote and keyboard and all buttons on the gamepad as you like by editing the keymapping.
From version 9.11 onwards there is a system keymapping in the system/keymaps/ subfolder of your installation. This keymapping applies to all users. In Xbox releases this is /Dashboard/system/Keymap.xml.
In addition to the system keymap you can create another keyboard.xml file in your userdata/keymaps/ folder. Any mappings you define add to or override mappings in the system keymap. In Xbox releases this does not apply (at present, based on T3CH SVN releases.)
If you use Linux then your userdata folder is $home/.xbmc/userdata so the full path to your keyboard.xml file is $home/.xbmc/userdata/keymaps/keyboard.xml.
If you use Windows the situation is a bit more complicated because it depends on whether you installed XBMC in default mode or portable mode. In portable mode the path to the file is C:\Program Files\XBMC\userdata\keymaps\keyboard.xml. In default mode the file is in your profile, in %APPDATA%\XBMC\userdata\keymaps\keyboard.xml, where APPDATA is an environment variable. In both default and portable mode, if the keymaps folder doesn't exist in your userdata folder just create it.
A side note: if you are using the 64 bit versions of Windows replace C:\Program Files\ by C:\Program Files (x86)\. If you didn't install XBMC into the Program Files folder then replace C:\Program Files\XBMC\ by whatever directory you chose at installation.
Changing the keymapping
There is one global keymap and several window-specific keymaps.
XBMC falls back to the global map when the window-specific map hasn't bound the key being pressed.
The format of keymapping files is as follows:
<xml> <keymap>
<global> <gamepad> <A>Select</A> ... </gamepad>
<remote> <select>Select</select> ... </remote>
<keyboard> <enter>Select</enter> ... </keyboard>
<universalremote> <obc25>XBMC.ActivateWindow(MyMusic)</obc25> ... </universalremote> </global>
<Home> ... </Home> ...
</keymap> </xml>
As you can see, it's divided into a <global> section, and a number of window sections (such as <Home>).
A list of the available window names can be seen here Window IDs. The WINDOW can also be a custom window formatted as <windowId#> (e. g. <window1113>).
Each of these sections has entries for Gamepad, Remote, Keyboard, and Universal Remotes.
The format for mapping a particular key under one of these device types is as follows: <xml>
<keyname>action</keyname>
</xml>
The important information is of course the keyname and action.
Keynames
The simplest type of keyname is just, for example, <a> for a press of the A key on the keyboard. From build 26407 onwards you can use the keyboard modifiers ctrl, shift and alt. For example to add a mapping for the keypress control-A you would use <a mod="ctrl">, while shift-alt-A would be <a mod="shift,alt">.
Finally if you want to add a mapping for some arbitrary key code you can use <key id="123"> where you replace "123" by the key code. You can the key code from xbmc.log. See the article List of XBMC keynames for details.
Available actions
An up to date list of the available actions can be found in the source code of XBMC in ButtonTranslator.cpp, where the TranslateActionString() function does the work.
In addition to the following actions, you can also use the Built-in functions available to FTP, Webserver, skins, keymap and to python in XBMC.
Action | Description |
Left | Move left off a control. |
Right | Move right off a control. |
Up | Move up off a control. |
Down | Move down off a control. |
Select | Select a button, or an item from a list of thumb view. |
PageUp | Scroll up on page in a list, thumb, or text view. |
PageDown | Scroll down on page in a list, thumb, or text view. |
Highlight | Highlight an item in a list or thumb view. |
ParentDir | Go up a folder to the parent folder. |
PreviousMenu | Go back to the previous menu screen. |
Info | Show the information about the currently highlighted item, or currently playing item. |
Pause | Pause the currently playing item. |
Stop | Stop the currently playing item. |
SkipNext | Skip to the next item in a playlist or scene in a video. |
SkipPrevious | Skip to the previous item in a playlist or scene in a video. |
FullScreen | Toggles fullscreen modes (either visualisation or video playback) |
AspectRatio | Toggle through the various aspect ratio modes (Normal is the preferred option). |
StepForward | Step forward 1% in the movie. |
StepBack | Step back 1% in the movie. |
BigStepForward | Step forward 10% in the movie. |
BigStepBack | Step back 10% in the movie. |
SmallStepBack | Step back 7 seconds in the current video. |
OSD | Toggles the OSD while playing an item. |
PlayDVD | Start playing a DVD (goes to the DVD menu) |
ShowVideoMenu | Go to the DVD Video menu when playing a DVD. |
ShowSubtitles | Toggles whether subtitles are shown or not. |
NextSubtitle | Change to the next subtitle language, if there is more than one. |
CodecInfo | Show codec information about the currently playing item (during video or visualisation playback) |
NextPicture | Move to the next picture in a slideshow. |
PreviousPicture | Move to the previous picture in a slideshow. |
ZoomOut | Used in picture or slideshow to zoom out of the current image. |
ZoomIn | Used in picture or slideshow to zoom in to the current image. |
Queue | Queue the item to the current playlist |
Playlist | Toggle to playlist view from My Music or My Videos |
ZoomNormal | Normal (fullscreen) viewing in My Pictures |
ZoomLevel1 | Zoom to 120% in My Pictures |
ZoomLevel2 | Zoom to 150% in My Pictures |
ZoomLevel3 | Zoom to 200% in My Pictures |
ZoomLevel4 | Zoom to 280% in My Pictures |
ZoomLevel5 | Zoom to 400% in My Pictures |
ZoomLevel6 | Zoom to 600% in My Pictures |
ZoomLevel7 | Zoom to 900% in My Pictures |
ZoomLevel8 | Zoom to 1350% in My Pictures |
ZoomLevel9 | Zoom to 2000% in My Pictures |
NextCalibration | Used in Video + GUI calibration |
ResetCalibration | Used in Video + GUI calibration |
AnalogMove | Move in the calibration screens, and while zoomed in My Pictures. |
Rotate | Rotate a picture in My Pictures |
Close | Used to close a dialog |
SubtitleDelayMinus | Decrease the delay amount of subtitles (use if subtitles are displaying too late) |
SubtitleDelayPlus | Increase the delay amount of subtitles (use if subtitles are displaying too early) |
AudioDelayMinus | Decrease the delay amount of audio (use if audio is being heard too early) |
AudioDelayPlus | Increase the delay amount of audio (use if audio is being heard too late) |
AudioNextLanguage | Change to the next audio track in a video with multiple audio tracks. |
NextResolution | Used in Video calibration |
Number0 | Used to input the number 0 |
Number1 | Used to input the number 1 |
Number2 | Used to input the number 2 |
Number3 | Used to input the number 3 |
Number4 | Used to input the number 4 |
Number5 | Used to input the number 5 |
Number6 | Used to input the number 6 |
Number7 | Used to input the number 7 |
Number8 | Used to input the number 8 |
Number9 | Used to input the number 9 |
FastForward | Toggle the fastforward speed between normal play, 2x, 4x, 8x, 16x, and 32x. |
Rewind | Toggle the rewind speed between normal play, 2x, 4x, 8x, 16x, and 32x. |
Play | Play the selected item (or folder of items), or unpause a paused item. |
Delete | Used in My Files to delete a file. |
Copy | Used in My Files to copy a file. |
Move | Used in My Files to move a file. |
Rename | Used in My Files to rename a file. |
HideSubmenu | <depreciated> |
Screenshot | Take a screenshot of the current screen. |
XBMC.ShutDown() | Shutdown and power off |
VolumeUp | Increase the volume of playback. |
VolumeDown | Decrease the volume of playback. |
Mute | Mute the volume. |
BackSpace | Used in the virtual keyboards to delete one letter. |
ScrollUp | Variable speed scroll up for analog keys (stick or triggers) |
ScrollDown | Variable speed scroll down for analog keys (stick or triggers) |
AnalogFastForward | Variable speed fast forward for analog keys (stick or triggers) |
AnalogRewind | Variable speed rewind for analog keys (stick or triggers) |
AnalogSeekForward | Variable speed seeking for analog keys (stick or triggers) |
AnalogSeekBack | Variable speed seeking for analog keys (stick or triggers) |
MoveItemUp | Used to rearrange playlists |
MoveItemDown | Used to rearrange playlists |
ContextMenu | Pops up a contextual menu |
Shift | Used in Virtual Keyboard to switch to upper or lower case letters |
Symbols | Used in Virtual Keyboard to switch to or from symbols mode |
CursorLeft | Used in Virtual Keyboard to move the current cursor point to the left |
CursorRight | Used in Virtual Keyboard to move the current cursor point to the right |
ShowTime | Used to show the current play time in music + video playback |
ShowPreset | Shows the current visualisation preset (milkdrop/spectrum) |
PresetList | Pops up the visualisation preset list (milkdrop/spectrum) |
NextPreset | Next visualisation preset |
PreviousPreset | Previous visualisation preset |
LockPreset | Lock the current visualisation preset |
RandomPreset | Switch to a new random preset |
IncreaseRating | Unused |
DecreaseRating | Unused |
ToggleWatched | Toggles watched/unwatched status for Videos |
NextLetter | Move to the next letter in a list or thumb panel. Note that SHIFT-B on the keyboard will take you to the B's. |
PrevLetter | Move to the previous letter in a list or thumb panel. Note that SHIFT-Z on the keyboard will take you to the Z's. |
JumpSMS2-9 | Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.) |
FilterSMS2-9 | Filter a list in music or videos using SMS-style input. |
XBMC.ActivateWindow(MyVideos) | Go to My Videos. |
XBMC.ActivateWindow(MyMusic) | Go to My Music. |
XBMC.ActivateWindow(MyPictures) | Go to My Pictures. |
XBMC.ActivateWindow(Home) | Go to Home window. Go back from within a context in the UI. |
Gamepad Buttons
An up to date list of the available actions can be found in the source code of XBMC in ButtonTranslator.cpp where the TranslateGamepadString() function does the work.
Remote Buttons
An up to date list of the available actions can be found in the source code of XBMC in ButtonTranslator.cpp where the TranslateRemoteString() function does the work.
The following buttons are available:
Button String | Button On Original XBOX Remote | Button On Media Extender Remote | Remote Code (Shown with <displayremotecodes>) |
left | Left | Left | 86 |
right | Right | Right | 87 |
up | Up | Up | 89 |
down | Down | Down | 88 |
select | Select | OK or Enter | 244 |
back | Back | Back | 39 |
menu | Menu | DVD Menu | 8 |
info | Info | More (Has an 'I' on it) | 60 |
display | Display | XBOX (Bottom) | 42 |
title | Title | Guide | 26 |
play | Play | Play | 21 |
pause | Pause | Pause | 25 |
reverse | Reverse | Rew | 29 |
forward | Forward | Fwd | 28 |
skipplus | Skip + | Skip | 32 |
skipminus | Skip - | Replay | 34 |
stop | Stop | Stop | 31 |
zero | 0 | 0 | 48 |
one | 1 | 1 | 49 |
two | 2 | 2 | 50 |
three | 3 | 3 | 51 |
four | 4 | 4 | 52 |
five | 5 | 5 | 53 |
six | 6 | 6 | 54 |
seven | 7 | 7 | 55 |
eight | 8 | 8 | 56 |
nine | 9 | 9 | 57 |
power | N/A | Power | 59 |
myTV | N/A | My TV | 206 |
mymusic | N/A | My Music | 246 |
mypictures | N/A | My Pictures | 249 |
myvideo | N/A | My Video | 248 |
record | N/A | Record | 23 |
start | N/A | Start | 218 |
volumeplus | N/A | Vol + | 47 |
volumeminus | N/A | Vol - | 46 |
channelplus | N/A | CH/PG + | 45 |
channelminus | N/A | CH/PG - | 44 |
pageplus | N/A | CH/PG + | 45 |
pageminus | N/A | CH/PG - | 44 |
mute | N/A | Mute | 63 |
recordedtv | N/A | Recorded TV | 154 |
livetv | N/A | Live TV | 231 |
star | N/A | * | 215 |
hash | N/A | # | 214 |
clear | N/A | Clear | 6 |
Universal Remotes
The Xbox uses standard RCA DVD/VCR infrared codes, so if you have a universal remote with a built in device database you can for example use a RCA DVD OFF code to power down the Xbox (this does not require editing the keymap, simply program one of your buttons as RCA DVD off).
To map Universal Remote buttons using the RCA infrared protocol, you may add <universalremote> sections to keymap.xml.
In this case, the tags used are <obc#> where # is the original button code (OBC) of the button.
You would put it inside an <universalremote> section in the <window> or <global> sections.
Example: <xml>
<universalremote> <obc148>Stop</obc148> </universalremote>
</xml>
- Will map Stop Playback to the RCA DVD repeat button <obc148>, which is not used by XBMC by default.
You could program your universal remote to restart XBMC without cold rebooting the Xbox by putting the following in the <global> section and map RCA Repeat to a button on your remote.
Example: <xml>
<universalremote> <obc148>XBMC.RestartApp</obc148> </universalremote>
</xml>
- Note: ensure that the <universalremote> section is NOT added 'within' the <remote> section - it can appear before or after. Otherwise it will not be recognised and produces errors in the logfile.
IMPORTANT:
XBMC can be put in a test mode to display the code number read when you press a button on your remote by setting <displayremotecodes> to true in advancedsettings.xml.
Keyboard
To map keys from an attached USB Keyboard, use the tags found in ButtonTranslator.cppwhere the TranslateKeyboardString does the work.
Key | Description, Notes |
Any Single character | that button on the keyboard, Case INSENSITIVE |
return | keypad enter |
enter | |
escape | also 'esc' |
tab | |
space | |
left | left-arrow |
right | right-arrow |
up | up-arrow |
down | down-arrow |
insert | |
delete | |
home | maintainers note: definition repeated in source code; doesn't harm functionality |
end | |
f1 | f1 - f12 available |
zero | zero -> nine; numpadzero -> numpadnine or 0 -> 9 are the same as zero -> nine |
numpadtimes | also numpadminus, numpadperiod, numpaddivide |
pageup | also pagedown |
printscreen | |
backspace | |
menu | unknown |
pause | |
leftshift | also rightshift, plus left/right ctrl, alt, windows |
capslock | also numlock, scrolllock |
semicolon | 'colon' is the SAME button code! |
plus | 'equals' is the SAME button code! |
minus | 'underscore' is the SAME button code! |
comma | 'lessthan' is the SAME button code! |
period | 'greaterthan' is the SAME button code! |
forwardslash | 'questionmark' is the SAME button code! |
leftquote | 'tilde' is the SAME button code! |
opensquarebracket | 'openbrace' is the SAME button code! |
backslash | 'pipe' is the SAME button code! |
closesquarebracket | 'closebrace' si the SAME button code! |
quote | 'doublequote' is the SAME button code! |