Thread Rating:
  • 0 Vote(s) - 0 Average
Loading keymaps via Python
I am helping to develop the TVCatchup EPG addin that streams UK television to XBMC.

We want to add custom controls when a stream is playing in full screen, for say changing channel up or down, jumping to channels, showing program information etc;

      <pageup>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, Up)</pageup>
      <pagedown>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, Down)</pagedown>      
      <zero>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 0)</zero>
      <one>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 1)</one>
      <two>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 2)</two>
      <three>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 3)</three>
      <four>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 4)</four>
      <five>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 5)</five>
      <six>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 6)</six>
      <seven>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 7)</seven>
      <eight>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 8)</eight>
      <nine>XBMC.RunScript(special://profile/addon_data/script.tvcatchup/, 9)</nine>

We currently acheive this using the custom keymap file shown above in the userdata/keymaps folder. When the addin is run it first checks if the file exists and if not copies the file from the addin folder to the keymap folder and then prompt the user to restart XBMC (obviously this only needs to be done the once).

There are a couple of issue with this, firstly having to restart XBMC the first time isn't ideal, and secondly and more importantly the keymapping we add will not be restricted to our addin but instead will be used when ever fullscreen video is being played (which we would rather not be the case).

So what would be great would be a way (I don't care how hacky) to get XBMC to rescan for new or removed keymaps within the addin.

This way when the addin is first started it could copy the keymap file across to the userdata/keymaps folder, and then force a rescan of the keymaps. When our addin is exited we could then delete the file and force another rescan.

Any one got any ideas, or would this require a new feature to be added to XBMC itself (a new builtin function perhaps)?
Well after more than a week of searching for a solution I finally stumbled upon what appears to be an undocumented feature:


Obvious when you know how!!
It more hidden than undocumented Wink
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe

Loading keymaps via Python00