Kodi Community Forum

Full Version: Multiple actions for keymap?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Keymap question...

Is it possible to have multiple actions when a key is hit?
- such as Dialog.Close(VideoOSD); ActivateWindow(TVGuide)

Alternatively, is it possible for a key to send a press to a button on the screen?
Yes. Just put all your actions in a .py script file and execute this script via a key-map definition.

E.g.:
In keymaps.xml

<key id="xxxxx">
runscript(special://masterprofile/addon_data/scripts/my actions.py)
</key>


In actions.py:

import xbmc

xbmc.executebuiltin("Action(SubtitleDelayPlus)")
xbmc.executebuiltin("Action(SubtitleDelayPlus)")
xbmc.executebuiltin("Action(SubtitleDelayPlus)")
xbmc.executebuiltin("Action(SubtitleDelayPlus)")
xbmc.executebuiltin("Action(SubtitleDelayPlus)")

This script lets me delay my subtitles 1/2 a second (5 times .1 seconds)
Cool, thanks!