Keymap

From Official Kodi Wiki
Revision as of 11:02, 22 December 2006 by >Kay.one (→‎Available actions)
Jump to navigation Jump to search

You can redefine all keys of the remote and all buttons on the gamepad as you like, by editing the keymapping which is defined in XBMC\UserData\keymap.xml on your Xbox.

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 keymap.xml 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.

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.
SkipPrevious Skip to the previous item in a playlist.
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.
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.
PowerOff 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

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 Description
left left button on the remote
right right button on the remote
up up button on the remote
down down button on the remote
select select button on the remote
back back button on the remote
menu menu button on the remote
info info button on the remote
display display button on the remote
title title button on the remote
play play button on the remote
pause pause button on the remote
reverse reverse button on the remote
forward forward button on the remote
skipplus skipplus button on the remote
skipminus skipminus button on the remote
stop stop button on the remote
zero zero button on the remote
one one button on the remote
two two button on the remote
three three button on the remote
four four button on the remote
five five button on the remote
six six button on the remote
seven seven button on the remote
eight eight button on the remote
nine nine button on the remote

Universal Remotes

To map keys from other remotes using the RC5 infrared remote protocol, you may add <universalremote> blocks to the keymap.
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: <xml>

   <universalremote>          
      <obc45>Stop</obc45>
   </universalremote>

</xml>

  • Note - ensure that the universalremote section is not added 'within' remote - it can appear before. Otherwise it will not recognise and produce 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.

The Xbox uses standard RCA DVD infrared codes, so if you have a universal remote with a built in device database you can use RCA DVD codes for example to power down the Xbox.


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, scrollock
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!