Some Help with python script to catch keypress on home
#1
I know very little about python within xbmc.

I'm trying to toggle a skin setting when the info key is pressed within the home window.
Really lost on this, i just can't get it to work.

Code:
import xbmc
import xbmcgui

ACTION_SHOW_INFO = 11

class MyClass(xbmcgui.WindowXML):
    def onAction(self, action):
        if action == ACTION_SHOW_INFO:
            if xbmc.getCondVisibility('[Control.HasFocus(8001)]') == 1:
                xbmc.executebuiltin("XBMC.Skin.ToggleSetting(HomeInfo)")
            else:
                xbmc.executebuiltin("Skin.Reset(HomeInfo)")
Madnox 2.0
Forum / Source
Reply
#2
(2015-06-04, 21:29)Mr. V Wrote: I know very little about python within xbmc.

I'm trying to toggle a skin setting when the info key is pressed within the home window.
Really lost on this, i just can't get it to work.

Code:
import xbmc
import xbmcgui

ACTION_SHOW_INFO = 11

class MyClass(xbmcgui.WindowXML):
    def onAction(self, action):
        if action == ACTION_SHOW_INFO:
            if xbmc.getCondVisibility('[Control.HasFocus(8001)]') == 1:
                xbmc.executebuiltin("XBMC.Skin.ToggleSetting(HomeInfo)")
            else:
                xbmc.executebuiltin("Skin.Reset(HomeInfo)")

Could probably do it using a customized keymap to detect the info key in the home window.

Depending on what your trying to do you might actually be able to put the functionality into your keymap, if not have a simple script that you call from the keymap.
Reply
#3
Thanks spoyser. I have the it working fine using a keymap. I was hoping I could avoid using a keymap.
Madnox 2.0
Forum / Source
Reply

Logout Mark Read Team Forum Stats Members Help
Some Help with python script to catch keypress on home0