def onAction(self, action): action = action.getId() if isinstance(action, xbmcgui.Action) else action action_js= self.keymap.get(action, None) if action_js: try: self.browser.executeJavaScript(action_js) except: pass if action_js == js_fn.close(): self.close()
def onAction(self, action): action = action.getId() if isinstance(action, xbmcgui.Action) else action action_js = self.keymap.get(action, None) if action_js: try: self.browser.executeJavaScript(action_js) except: pass if action_js == js_fn.close(): self.close()
import xbmcgui import xbmcaddon import send_keys import subprocess from utils import * DEFAULT_KEYMAP = { xbmcgui.ACTION_SELECT_ITEM: js_fn.keypress(js_fn.keycode.space), xbmcgui.ACTION_MOVE_LEFT: js_fn.keypress(js_fn.keycode.left), xbmcgui.ACTION_MOVE_RIGHT: js_fn.keypress(js_fn.keycode.right), xbmcgui.ACTION_MOVE_UP: js_fn.keypress(js_fn.keycode.up), xbmcgui.ACTION_MOVE_DOWN: js_fn.keypress(js_fn.keycode.down), xbmcgui.ACTION_PLAY: js_fn.keypress(js_fn.keycode.space), xbmcgui.ACTION_NAV_BACK: js_fn.close(), xbmcgui.ACTION_PARENT_DIR: js_fn.close(), xbmcgui.ACTION_PREVIOUS_MENU: js_fn.close(), xbmcgui.ACTION_STOP: js_fn.close(), xbmcgui.ACTION_SHOW_INFO: js_fn.close(), xbmcgui.ACTION_SHOW_GUI: js_fn.close(), } class WindowXMLDialogActions(xbmcgui.WindowXMLDialog): # def __init__(self, strXMLname, strFallbackPath, strDefaultName, forceFallback=0, parent = None): # self.parent = parent # xbmcgui.WindowXMLDialog.__init__( self ) TEXTBOX_ID = 7509 OK_BUTTON_ID = 7510
import xbmcgui import xbmcaddon import send_keys import subprocess from utils import * DEFAULT_KEYMAP = { xbmcgui.ACTION_SELECT_ITEM : js_fn.keypress(js_fn.keycode.space), xbmcgui.ACTION_MOVE_LEFT : js_fn.keypress(js_fn.keycode.left), xbmcgui.ACTION_MOVE_RIGHT : js_fn.keypress(js_fn.keycode.right), xbmcgui.ACTION_MOVE_UP : js_fn.keypress(js_fn.keycode.up), xbmcgui.ACTION_MOVE_DOWN : js_fn.keypress(js_fn.keycode.down), xbmcgui.ACTION_PLAY : js_fn.keypress(js_fn.keycode.space), xbmcgui.ACTION_NAV_BACK : js_fn.close(), xbmcgui.ACTION_PARENT_DIR : js_fn.close(), xbmcgui.ACTION_PREVIOUS_MENU : js_fn.close(), xbmcgui.ACTION_STOP : js_fn.close(), xbmcgui.ACTION_SHOW_INFO : js_fn.close(), xbmcgui.ACTION_SHOW_GUI : js_fn.close(), } class WindowXMLDialogActions(xbmcgui.WindowXMLDialog): # def __init__(self, strXMLname, strFallbackPath, strDefaultName, forceFallback=0, parent = None): # self.parent = parent # xbmcgui.WindowXMLDialog.__init__( self ) TEXTBOX_ID = 7509 OK_BUTTON_ID = 7510