<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pedram</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pedram"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Pedram"/>
	<updated>2026-06-15T19:19:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=Keymap&amp;diff=124064</id>
		<title>Keymap</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Keymap&amp;diff=124064"/>
		<updated>2016-08-25T04:02:06Z</updated>

		<summary type="html">&lt;p&gt;Pedram: /* Remotes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav| [[Remote controls]] }}&lt;br /&gt;
&amp;lt;section begin=&amp;quot;intro&amp;quot; /&amp;gt;Keymaps are XML base files that define the mappings of keys (keyboard keys, mouse/remote/joysticks buttons and more) to Kodi actions.&amp;lt;section end=&amp;quot;intro&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Customizing keymaps through the GUI ==&lt;br /&gt;
{{main|Add-on:Keymap Editor}}&lt;br /&gt;
Users can customize keymaps for remotes in GUI by using the community [[Add-on:Keymap Editor|Keymap Editor]] add-on.&lt;br /&gt;
&lt;br /&gt;
== Location of keymaps ==&lt;br /&gt;
User modified keymap files must be stored in the &amp;quot;&#039;&#039;&#039;keymaps&#039;&#039;&#039;&amp;quot; folder in the [[userdata]] folder:&lt;br /&gt;
{{#lsth:userdata|Location of the UserData folder}}&lt;br /&gt;
&lt;br /&gt;
=== Defaults ===&lt;br /&gt;
Default keymaps are included when Kodi is installed, but users should not edit those install files directly. Instead, place user modified keymaps in the [[userdata]]/keymaps/ directory.&lt;br /&gt;
&lt;br /&gt;
Kodi can process multiple keymap files and does so like this:&lt;br /&gt;
&lt;br /&gt;
* All *.xml files from the default install settings and userdata/kemaps/ folders are applied as keymaps.&lt;br /&gt;
* All *.xml files are processed in alphabetical order.&lt;br /&gt;
* Keymaps defined in an .xml file add to or override mappings in previous .xml file.&lt;br /&gt;
* Keymaps defined in the userdata folder add to or override mappings in the global keymap.&lt;br /&gt;
&lt;br /&gt;
By default there will be no files in these locations, so grab one from the link below to make a new one/over-ride:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039; https://github.com/xbmc/xbmc/tree/master/system/keymaps &#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039; https://github.com/kodi-game/peripheral.joystick/tree/master/peripheral.joystick/resources/buttonmaps/xml &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
There is one &#039;&#039;&#039;global&#039;&#039;&#039; keymap and several &#039;&#039;&#039;window&#039;&#039;&#039;-specific keymaps.&amp;lt;br /&amp;gt;&lt;br /&gt;
Kodi falls back to the global map when the window-specific map hasn&#039;t bound the key being pressed.&lt;br /&gt;
&lt;br /&gt;
The format of keymapping files is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;keymap&amp;gt;&lt;br /&gt;
  &amp;lt;global&amp;gt;&lt;br /&gt;
    &amp;lt;gamepad&amp;gt;&lt;br /&gt;
      &amp;lt;A&amp;gt;Select&amp;lt;/A&amp;gt;&lt;br /&gt;
      [...]&lt;br /&gt;
    &amp;lt;/gamepad&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;remote&amp;gt;&lt;br /&gt;
      &amp;lt;select&amp;gt;Select&amp;lt;/select&amp;gt;&lt;br /&gt;
      [...]&lt;br /&gt;
    &amp;lt;/remote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;keyboard&amp;gt;&lt;br /&gt;
      &amp;lt;enter&amp;gt;Select&amp;lt;/enter&amp;gt;&lt;br /&gt;
      [...]&lt;br /&gt;
    &amp;lt;/keyboard&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;universalremote&amp;gt;&lt;br /&gt;
      &amp;lt;obc25&amp;gt;XBMC.ActivateWindow(MyMusic)&amp;lt;/obc25&amp;gt;&lt;br /&gt;
      [...]&lt;br /&gt;
    &amp;lt;/universalremote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;joystick name=&amp;quot;PLAYSTATION(R)3 Controller (00:1B:FB:F6:E0:F2)&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;button id=&amp;quot;15&amp;quot;&amp;gt;Select&amp;lt;/button&amp;gt;&lt;br /&gt;
      [...]&lt;br /&gt;
    &amp;lt;/joystick&amp;gt;&lt;br /&gt;
  &amp;lt;/global&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Home&amp;gt;&lt;br /&gt;
    [...]&lt;br /&gt;
  &amp;lt;/Home&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/keymap&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it&#039;s divided into a &amp;lt;global&amp;gt; section, and a number of window sections (such as &amp;lt;Home&amp;gt;).&amp;lt;br /&amp;gt;&lt;br /&gt;
A list of the available window names can be seen [[Window IDs|here]]. The WINDOW can also be a custom window formatted as &amp;lt;windowId#&amp;gt; (e. g. &amp;lt;window1113&amp;gt;). &amp;lt;br /&amp;gt;&lt;br /&gt;
Each of these sections can contain Gamepad, Remote, Keyboard, Universal Remote, and custom Joystick sections.&lt;br /&gt;
&lt;br /&gt;
The format for mapping a particular key under one of these device types is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;keyname&amp;gt;action&amp;lt;/keyname&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keynames ==&lt;br /&gt;
Depending on your device you will need to use a specific &amp;quot;keyname&amp;quot;.&lt;br /&gt;
=== Gamepads ===&lt;br /&gt;
An up to date list of the available actions can be found in the source code of Kodi in [https://github.com/xbmc/xbmc/blob/master/xbmc/input/ButtonTranslator.cpp ButtonTranslator.cpp] where the &#039;&#039;TranslateGamepadString()&#039;&#039; function does the work.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gamepad&amp;gt;&lt;br /&gt;
  &amp;lt;A&amp;gt;Select&amp;lt;/A&amp;gt;&lt;br /&gt;
&amp;lt;/gamepad&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remotes ===&lt;br /&gt;
An up to date list of the available actions can be found in the source code of Kodi in [https://github.com/xbmc/xbmc/blob/master/xbmc/input/ButtonTranslator.cpp ButtonTranslator.cpp] where the &#039;&#039;TranslateRemoteString()&#039;&#039; function does the work.&lt;br /&gt;
&lt;br /&gt;
{{Note|Some remotes are actually seen as &amp;quot;keyboards&amp;quot;. Those will need to use the &amp;lt;keyboard&amp;gt; tag instead.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remote&amp;gt; &lt;br /&gt;
  &amp;lt;play&amp;gt;Play&amp;lt;/play&amp;gt;&lt;br /&gt;
&amp;lt;/remote&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Universal Remotes ===&lt;br /&gt;
To map Universal Remote buttons using the RCA infrared protocol, you may add &#039;&#039;&#039;&amp;lt;universalremote&amp;gt;&#039;&#039;&#039; sections to keymap.xml.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this case, the tags used are &amp;lt;obc#&amp;gt; where # is the original button code (OBC) of the button.&amp;lt;br /&amp;gt;&lt;br /&gt;
You would put it inside a &amp;lt;universalremote&amp;gt; section in the &amp;lt;window&amp;gt; or &amp;lt;global&amp;gt; sections.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;universalremote&amp;gt; &lt;br /&gt;
  &amp;lt;obc148&amp;gt;Stop&amp;lt;/obc148&amp;gt;&lt;br /&gt;
&amp;lt;/universalremote&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Will map &#039;&#039;Stop Playback&#039;&#039; to the RCA DVD repeat button &amp;lt;obc148&amp;gt;, which is not used by Kodi by default. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; ensure that the &amp;lt;universalremote&amp;gt; section is &#039;&#039;&#039;NOT&#039;&#039;&#039; added &#039;within&#039; the &amp;lt;remote&amp;gt; section - it can appear before or after. Otherwise it will not be recognised and produces errors in the logfile.&lt;br /&gt;
&lt;br /&gt;
Remote keys can be observed in the kodi.log file (&#039;&#039;&#039;~/.kodi/temp/kodi.log&#039;&#039;&#039; on Linux) when debugging is enabled in the GUI (Settings -&amp;gt; debugging ). The list of pre-defined OBC codes can be found at [https://github.com/xbmc/xbmc/blob/master/xbmc/input/XBIRRemote.h XBIRRemote.h].&lt;br /&gt;
&lt;br /&gt;
=== Keyboards ===&lt;br /&gt;
Valid keyboard keymap syntax includes &amp;lt;keyname&amp;gt;, &amp;lt;key id=&amp;quot;&amp;quot;&amp;gt;, and &amp;lt;keyname mod=&amp;quot;&amp;quot;&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Mapping for arbitrary key codes can be configured using the following syntax: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;key id=&amp;quot;123&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
where &amp;quot;123&amp;quot; is replaced by the key code.&lt;br /&gt;
&lt;br /&gt;
A full list of valid keynames can be found in &lt;br /&gt;
* the &#039;&#039;TranslateKeyboardString()&#039;&#039; method in [https://github.com/xbmc/xbmc/blob/master/xbmc/input/ButtonTranslator.cpp ButtonTranslator.cpp] &lt;br /&gt;
* or in [[List of Kodi keynames]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;keyboard&amp;gt;&lt;br /&gt;
  &amp;lt;key id=&amp;quot;123&amp;quot;&amp;gt;action&amp;lt;/key&amp;gt; -- id is the keys keycode. &amp;gt;&lt;br /&gt;
  &amp;lt;a mod=&amp;quot;shift,alt&amp;quot;&amp;gt;action&amp;lt;/a&amp;gt; -- corresponds to shift-alt-a, the mod=&amp;quot;&amp;quot; syntax is enabled since build 26407. &amp;gt;&lt;br /&gt;
  &amp;lt;space&amp;gt;action&amp;lt;/space&amp;gt; -- for a complete list of valid keynames, see ButtonTranslator.cpp or List of Kodi keynames above. &amp;gt;&lt;br /&gt;
&amp;lt;/keyboard&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Modifiers&lt;br /&gt;
* shift&lt;br /&gt;
* alt&lt;br /&gt;
* ctrl&lt;br /&gt;
&lt;br /&gt;
=== Custom Joystick Configuration ===&lt;br /&gt;
Custom joysticks are defined using the following syntax:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;joystick name=&amp;quot;JOYSTICK NAME&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;button id=&amp;quot;BUTTON ID&amp;quot;&amp;gt;action&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/joystick&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getting the joystick name:&lt;br /&gt;
* On linux: &#039;cat /proc/bus/input/devices&#039;&lt;br /&gt;
* or see your Kodi log file&lt;br /&gt;
&lt;br /&gt;
Getting the button ids:&lt;br /&gt;
* &#039;id&#039; is the button ID used by SDL. Joystick button ids of connected joysticks appear in kodi.log when they are pressed. Use your log to map custom buttons to actions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;joystick name=&amp;quot;PLAYSTATION(R)3 Controller (00:1B:FB:F6:E0:F2)&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;button id=&amp;quot;15&amp;quot;&amp;gt;Select&amp;lt;/button&amp;gt;&lt;br /&gt;
  &amp;lt;button id=&amp;quot;14&amp;quot;&amp;gt;PreviousMenu&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;/joystick&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Long-press ==&lt;br /&gt;
Depending on the device, many remotes, keyboards, and gamepads can use the long-press modifier. This allows a button to do a separate action when held for a short period of time. The syntax for this is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;button mod=&amp;quot;longpress&amp;quot;&amp;gt;action&amp;lt;/button&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not all devices will correctly work with the longpress action, but most should. &lt;br /&gt;
&lt;br /&gt;
{{Note|Long-press will disable keyrepeat for that key/window.}}&lt;br /&gt;
&lt;br /&gt;
=== Removing a long-press action from a default keymap ===&lt;br /&gt;
If you want to simply remove a long-press action, rather than override it, you can place an empty long-press tag in a keymap. This also has the effect of re-enabling keyrepeat for the short-press action.&lt;br /&gt;
&lt;br /&gt;
For example, this will remove the context menu action from the default keyboard.xml keymap:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;keymap&amp;gt;&lt;br /&gt;
  &amp;lt;global&amp;gt;&lt;br /&gt;
    &amp;lt;keyboard&amp;gt;&lt;br /&gt;
      &amp;lt;return mod=&amp;quot;longpress&amp;quot;&amp;gt;&amp;lt;/return&amp;gt;&lt;br /&gt;
      &amp;lt;enter mod=&amp;quot;longpress&amp;quot;&amp;gt;&amp;lt;/enter&amp;gt;&lt;br /&gt;
    &amp;lt;/keyboard&amp;gt;&lt;br /&gt;
  &amp;lt;/global&amp;gt;&lt;br /&gt;
&amp;lt;/keymap&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
The most recent available actions can be found in the &#039;&#039;TranslateActionString()&#039;&#039; method in in [https://github.com/xbmc/xbmc/blob/master/xbmc/input/ButtonTranslator.cpp ButtonTranslator.cpp].&lt;br /&gt;
&lt;br /&gt;
For those debugging integer action codes from the debug log, the mapping of action codes to constants is in [https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h Key.h]&lt;br /&gt;
&lt;br /&gt;
In addition to the following actions, you can also use &#039;&#039;&#039;[[Built-in scripting]]&#039;&#039;&#039; in Kodi.&lt;br /&gt;
&lt;br /&gt;
=== Actions ===&lt;br /&gt;
{{Main|Action IDs}}&lt;br /&gt;
{{#lst:Action IDs|Action IDs}}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
{{main|List of built-in functions|Built-in scripting}}&lt;br /&gt;
{{#lst:List of built-in functions|functions}}&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
{{main|Window IDs}}&lt;br /&gt;
{{#lst:Window IDs|main content}}&lt;br /&gt;
&lt;br /&gt;
== Additional keys ==&lt;br /&gt;
Other keys that can be mapped to actions.&lt;br /&gt;
&lt;br /&gt;
=== Media keyboards/remotes ===&lt;br /&gt;
* browser_back&lt;br /&gt;
* browser_forward&lt;br /&gt;
* browser_refresh&lt;br /&gt;
* browser_stop&lt;br /&gt;
* browser_search&lt;br /&gt;
* browser_favorites&lt;br /&gt;
* browser_home&lt;br /&gt;
* volume_mute&lt;br /&gt;
* volume_down&lt;br /&gt;
* volume_up&lt;br /&gt;
* next_track&lt;br /&gt;
* prev_track&lt;br /&gt;
* stop&lt;br /&gt;
* play_pause&lt;br /&gt;
* launch_mail&lt;br /&gt;
* launch_media_select&lt;br /&gt;
* launch_app1&lt;br /&gt;
* launch_app2&lt;br /&gt;
* play&lt;br /&gt;
* pause&lt;br /&gt;
* fastforward&lt;br /&gt;
* rewind&lt;br /&gt;
* channelup&lt;br /&gt;
* channeldown&lt;br /&gt;
&lt;br /&gt;
=== Mouse actions ===&lt;br /&gt;
* leftclick&lt;br /&gt;
* rightclick &lt;br /&gt;
* middleclick&lt;br /&gt;
* doubleclick&lt;br /&gt;
* wheelup&lt;br /&gt;
* wheeldown&lt;br /&gt;
* mousemove&lt;br /&gt;
* mousedrag&lt;br /&gt;
* mousedragstart&lt;br /&gt;
* mousedragend&lt;br /&gt;
* mouserdrag - right button drag&lt;br /&gt;
* mouserdragstart - start of right button drag&lt;br /&gt;
* mouserdragend - end of right button drag&lt;br /&gt;
&lt;br /&gt;
== Examples and pre-made keymaps ==&lt;br /&gt;
{{see|:Category:Custom keymaps}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Remote controls]]&lt;br /&gt;
* [[Keyboard controls]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Skinning]]&lt;br /&gt;
&lt;br /&gt;
{{Updated|16}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Manual]]&lt;br /&gt;
[[Category:Remotes]]&lt;br /&gt;
[[Category:Settings]]&lt;br /&gt;
[[Category:Controls]]&lt;/div&gt;</summary>
		<author><name>Pedram</name></author>
	</entry>
</feed>