Skins can use built-in functions with the <onclick> or <onfocus> tag. Scripts can call built-in functions with xbmc.executebuiltin(function, block)
.
The latest up-to-date list of built-in functions can be found in the source code files in [1].
In addition to the following list, for most <onclick> and <onfocus> button actions in the skin you can also use the functions from Keyboard.xml.
Function
|
Description
|
Version
|
Addon.Default.OpenSettings(extensionpoint)
|
Open a settings dialog for the default addon of the given type (extensionpoint)
|
|
Addon.Default.Set(extensionpoint)
|
Open a select dialog to allow choosing the default addon of the given type (extensionpoint)
|
|
Addon.OpenSettings(id)
|
Open a settings dialog for the addon of the given id
|
|
EnableAddon(id)
|
Enables the specified plugin/script
|
v19 addition
|
InstallAddon(id)
|
Will install the addon with the given id.
|
|
InstallFromZip
|
Opens the "Install from zip"-dialog if "Unknown sources" is enabled. Prompts the warning message if not.
|
|
RunAddon(id)
|
Runs the specified plugin/script
|
|
RunAppleScript(script[,args]*)
|
Run the specified AppleScript command
|
|
RunPlugin(plugin)
|
Runs the plugin. Full path must be specified. Does not work for folder plugins
|
|
RunScript(script[,args]*)
|
Runs the python script. You must specify the add-on id of the script. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv
|
|
StopScript(id)
|
Stop the script by ID or path, if running
|
v12 Addition
|
UpdateAddonRepos
|
Triggers a forced update of enabled add-on repositories.
|
|
UpdateLocalAddons
|
Triggers a scan of local add-on directories.
|
|
Function
|
Description
|
Version
|
Action(action[,window])
|
Executes an action (same as in keymap) for the given window or the active window if the parameter window is omitted. The parameter window can either be the window's id, or in the case of a standard window, the window's name. See Action IDs for a list of available actions.
|
|
ActivateWindow(window[,dir,return])
|
Opens the given window. The parameter window can either be the window's id, or in the case of a standard window, the window's name. See Window IDs for a list of window names, and their respective ids. If, furthermore, the window is Music, Video, Pictures, or Program files, then the optional dir parameter specifies which folder Kodi should default to once the window is opened. This must be a source as specified in sources.xml, or a subfolder of a valid source. For some windows (MusicLibrary and VideoLibrary), the return parameter may be specified, which indicates that Kodi should use this folder as the "root" of the level, and thus the "parent directory" action from within this folder will return the user to where they were prior to the window activating.
|
|
ActivateWindowAndFocus(id1, id2,item1, id3,item2)
|
Activate window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0).
|
v12 Addition
|
AlarmClock(name,command,time[,silent,loop])
|
Pops up a dialog asking for the length of time (mm:ss) for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the built-in command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice. Add silent to hide the alarm notification. Add loop for the alarm to execute the command each time the specified time interval expires.
|
|
CancelAlarm(name[,silent])
|
Cancel a running alarm. Set silent to true to hide the alarm notification.
|
|
ClearProperty(key[,id])
|
Clears a window property for the current focused window/dialog(key), or the specified window (key,id).
|
|
Dialog.Close(dialog[,force])
|
Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.
|
|
NextChannelGroup
|
Navigate to the next PVR channel group (in DialogPVRChannelsOSD.xml)
|
v13 Addition
|
NextStereoMode
|
Changes the stereo mode of the GUI to the next available mode.
|
v13 Addition
|
Notification(header,message[,time,image])
|
Will display a notification dialog with the specified header and message, in addition you can set the length of time it displays in milliseconds and a icon image.
|
|
PreviousChannelGroup
|
Navigate to the previous PVR channel group (in DialogPVRChannelsOSD.xml)
|
v13 Addition
|
PreviousStereoMode
|
Changes the stereo mode of the GUI to the previous available mode.
|
v13 Addition
|
RefreshRSS
|
Reload RSS feeds from RSSFeeds.xml
|
|
ReplaceWindow(window,dir)
|
Replaces the current window with the given window. This is the same as ActivateWindow() but it doesn't update the window history list, so when you go back from the new window it will not return to the previous window, rather will return to the previous window's previous window.
|
|
ReplaceWindowAndFocus(id1, id2,item1, id3,item2)
|
Replace window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0).
|
v13 Addition
|
Resolution
|
Change Kodi's Resolution.
|
|
SetGUILanguage(value)
|
Set GUI Language, 'value' is the language file to use. SetGUILanguage(resource.language.de_de)
|
v13 Addition
|
SetProperty(key,value[,id])
|
Sets a window property for the current window (key,value), or the specified window (key,value,id).
|
|
SetStereoMode
|
Changes the stereo mode of the GUI. Params can be: toggle, next, previous, select, tomono or any of the supported stereomodes (off, split_vertical, split_horizontal, row_interleaved, hardware_based, anaglyph_cyan_red, anaglyph_green_magenta, monoscopic)
|
v13 Addition
|
settingslevelchange
|
Toggles the visible settings (in SettingsCategory.xml) between 'basic', 'standard', 'advanced and 'expert'
|
v13 Addition
|
TakeScreenshot([filenameandpath,sync])
|
Takes a Screenshot. You can optionally specify the filename (including the path). Note: only .png files are supported. Add "sync" parameter to run synchronously (slow).
|
|
ToggleDirtyRegionVisualization
|
makes dirty regions visible for debugging proposes.
|
v16 Addition
|
ToggleStereoMode
|
Toggle the stereoscopic mode of the GUI (on/off).
|
v13 Addition
|
Function
|
Description
|
Version
|
Control.Message(id,message,[windowid])
|
Sends a given message to a control in a given window (or active window if omitted). Messages can be movedown, moveup, pagedown, pageup, click.
|
|
Control.Move(id,offset)
|
Will make a Container with the "id" specified in the command move focus by "offset".
|
|
Control.SetFocus(id,position[,absolute])
|
Will make a list with the "id" specified in the command gain focus at "position" number in its list. Set absolute to focus the first listitem of a container instead of the first visible listitem. Alias SetFocus(id,position)
|
|
PageDown
|
Send a page down event to the pagecontrol with given id.
|
|
PageUp
|
Send a page up event to the pagecontrol with given id.
|
|
SendClick(windowid,id)
|
Sends a click to a control in a given window (or active window if omitted).
|
|
SetFocus(id,position[,absolute])
|
Will make a list with the "id" specified in the command gain focus at "position" number in its list. Set absolute to focus the first listitem of a container instead of the first visible listitem. Alias Control.SetFocus(id,position)
|
|
Function
|
Description
|
Version
|
PlayDisc(param)
|
Will play the inserted CD or DVD media from the DVD-ROM drive.
|
|
PlayerControl(command)
|
Allows control of music and videos. The command may be one of Play, Stop, Forward, Rewind, Next, Previous, BigSkipForward, BigSkipBackward, SmallSkipForward, SmallSkipBackward, FrameAdvance(#), TempoUp, TempoDown, Tempo(value), Random, RandomOn, RandomOff, Repeat, RepeatOne, RepeatAll, RepeatOff, Partymode(music) or Partymode(video) or Partymode(path to .xsp file) or Reset.
Play will either pause, resume, or stop ffwding or rewinding. Random toggles random playback and Repeat cycles through the repeat modes (these both take an optional second parameter, Notify, that notifies the user of the new state). Partymode(music/video) toggles the appropriate partymode, defaults to music if no parameter is given, besides the default music or video partymode you can also pass a path to a custom smartplaylist (.xsp) as parameter. Reset only applies to games and will reset the currently playing game.
|
|
PlayerResolutionSelect
|
Select a different resolution
|
v18
|
Playlist.Clear
|
Clear the current playlist
|
|
Playlist.PlayOffset
|
Start playing from a particular offset in the playlist
|
|
PlayMedia(media[,isdir][,1],[playoffset=xx],[resume],[noresume])
|
Plays the media. This can be a playlist, music, or video file, directory, plugin or a url. The optional parameter ",isdir" can be used for playing a directory. ",1" will start the media without switching to fullscreen. If media is a playlist, you can use playoffset=xx where xx is the position to start playback from. Set "resume" to force resuming. Set "noresume" to force not resuming.
|
|
PlayWith()
|
Play the selected item with the specified player core.
|
|
Seek(seconds)
|
Seeks to the specified relative amount of seconds within the current playing media. A negative value will seek backward and a positive value forward.
|
v15 Addition
|
Function
|
Description
|
Version
|
ReloadSkin()
|
Reloads the current skin – useful for Skinners to use after they upload modified skin files (saves power cycling)
|
|
Skin.Reset(setting)
|
Resets the skin setting ?setting?. If ?setting? is a bool setting (i.e. set via SetBool or ToggleSetting) then the setting is reset to false. If ?setting? is a string (Set via SetString, SetImage, or SetPath) then it is set to empty.
|
|
Skin.ResetSettings
|
Resets all the above skin settings to their defaults (toggles all set to false, strings all set to empty.)
|
|
Skin.SelectBool(header, label1|setting1, label2|setting2)
|
Pops up select dialog to select between multiple skin setting options. Skin.SelectBool(424, 31411|RecentWidget, 31412|RandomWidget, 31413|InProgressWidget)
|
|
Skin.SetAddon(string,type)
|
Pops up a select dialog and allows the user to select an add-on of the given type to be used elsewhere in the skin via the info tag Skin.String(string). The most common types are xbmc.addon.video, xbmc.addon.audio, xbmc.addon.image, xbmc.addon.executable and kodi.gameclient.
|
|
Skin.SetBool(setting)
|
Sets the skin setting ?setting? to true, for use with the conditional visibility tags containing Skin.HasSetting(setting). The settings are saved per-skin in settings.xml just like all the other Kodi settings.
|
|
Skin.SetFile(string,mask,folderpath)
|
Pops up a folder browser and allows the user to select a file off the hard-disk to be used else where in the skin via the info tag Skin.String(string). If the mask parameter is specified, then the file browser will only search for the extension specified (.avi,.mp3,.m3u,.png,.bmp,etc.,etc.). To use multiple extensions separate them using "|" (minus quotes). If the folderpath parameter is set the file browser will start in that folder.
|
|
Skin.SetImage(string[,value,path])
|
Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin via the info tag Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly. the path option allows you to open the file browser in the specified folder.
|
|
Skin.SetNumeric(numeric[,value])
|
Pops up a keyboard dialog and allows the user to input a numerical.
|
|
Skin.SetPath(string[,folderpath])
|
Pops up a folder browser and allows the user to select a folder of images to be used in a multi image control else where in the skin via the info tag Skin.String(string). If the folderpath parameter is set the file browser will start in that folder.
|
|
Skin.SetString(string[,value])
|
Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin via the info tag Skin.String(string). If the value parameter is specified, then the keyboard dialog does not pop up, and the string is set directly.
|
|
Skin.Theme(1)
|
Cycles the skin theme. Skin.Theme(-1) will go backwards.
|
|
Skin.ToggleDebug
|
Toggles skin debug info on/off
|
|
Skin.ToggleSetting(setting)
|
Toggles the skin setting ?setting? for use with conditional visibility tags containing Skin.HasSetting(setting).
|
|
UnloadSkin()
|
Unloads the current skin
|
|