Hotkey: Allow short/long on Radio and TV button
authorlittlesat <littlesat99@yahoo.com>
Wed, 6 Jan 2016 19:49:37 +0000 (20:49 +0100)
committerlittlesat <littlesat99@yahoo.com>
Wed, 6 Jan 2016 19:49:37 +0000 (20:49 +0100)
This for the VU+Solo4K. Long TV will be default toggle TV on display. Also
relocate this function for the ET8K5

data/keymap.xml
lib/python/Screens/Hotkey.py

index 1432f22..28410de 100644 (file)
 
        <map context="InfobarActions">
                <key id="KEY_VIDEO" mapto="showMovies" flags="m"/>
-               <key id="KEY_RADIO" mapto="showRadio" flags="m"/>
-               <key id="KEY_TV" mapto="showTv" flags="m"/>
+               <key id="KEY_RADIO" mapto="showRadio" flags="b"/>
+               <key id="KEY_TV" mapto="showTv" flags="b"/>
                <key id="KEY_FILE" mapto="showMovies" flags="m"/>
                <key id="KEY_TEXT" mapto="showText" flags="m"/>
        </map>
                </device>
                <key id="KEY_EXIT" mapto="exit" flags="m"/>
                <key id="KEY_ESC" mapto="exit" flags="m"/>
-               <key id="KEY_TV" mapto="exit" flags="m"/>
+               <key id="KEY_TV" mapto="exit" flags="b"/>
        </map>
 
        <map context="GlobalActions">
        <map context="InfobarTimeshiftActions">
                <device name="dreambox remote control (native)">
                        <key id="KEY_YELLOW" mapto="timeshiftStart" flags="b"/>
-                       <key id="KEY_TV" mapto="timeshiftStop" flags="m"/>
+                       <key id="KEY_TV" mapto="timeshiftStop" flags="b"/>
                </device>
                <device name="dreambox ir keyboard">
                        <key id="KEY_YELLOW" mapto="timeshiftStart" flags="m"/>
        </map>
 
        <map context="MoviePlayerActions">
-               <key id="KEY_TV" mapto="leavePlayer" flags="m"/>
+               <key id="KEY_TV" mapto="leavePlayer" flags="b"/>
                <key id="KEY_STOP" mapto="leavePlayer" flags="m"/>
                <key id="KEY_EXIT" mapto="leavePlayerOnExit" flags="m"/>
                <key id="KEY_ESC" mapto="leavePlayerOnExit" flags="m"/>
        </map>
 
        <map context="TvRadioActions">
-               <key id="KEY_TV" mapto="keyTV" flags="m"/>
-               <key id="KEY_RADIO" mapto="keyRadio" flags="m"/>
+               <key id="KEY_TV" mapto="keyTV" flags="b"/>
+               <key id="KEY_RADIO" mapto="keyRadio" flags="b"/>
        </map>
 
        <map context="TimerEditActions">
                        <key id="KEY_TV" mapto="tv" flags="m"/>
                        <key id="KEY_STOP" mapto="tv" flags="m"/>
                        <key id="KEY_RADIO" mapto="dvdAudioMenu" flags="l"/>
-                       <key id="KEY_RADIO" mapto="nextAudioTrack" flags="m"/>
+                       <key id="KEY_RADIO" mapto="nextAudioTrack" flags="b"/>
                        <key id="KEY_TEXT" mapto="nextSubtitleTrack" flags="m"/>
                        <key id="KEY_VIDEO" mapto="nextAngle" flags="m"/>
                </device>
                <key id="KEY_BLUE" mapto="blue" flags="b"/>
                <key id="KEY_BLUE" mapto="blue_long" flags="l"/>
                <key id="KEY_RECORD" mapto="rec" flags="m"/>
-               <key id="KEY_RADIO" mapto="radio" flags="m"/>
-               <key id="KEY_TV" mapto="showTv" flags="m"/>
+               <key id="KEY_RADIO" mapto="radio" flags="b"/>
+               <key id="KEY_RADIO" mapto="radio_long" flags="l"/>
+               <key id="KEY_TV" mapto="showTv" flags="b"/>
+               <key id="KEY_TV" mapto="showTv_long" flags="l"/>
                <key id="KEY_TEXT" mapto="text" flags="m"/>
                <key id="KEY_HELP" mapto="displayHelp" flags="b"/>
                <key id="KEY_HELP" mapto="displayHelp_long" flags="l"/>
index 93d77c6..cce8d90 100644 (file)
@@ -30,7 +30,9 @@ def getHotkeys():
                (_("Blue"), "blue", ""),
                ("Rec", "rec", ""),
                ("Radio", "radio", ""),
+               ("Radio" + " " + _("long"), "radio_long", ""),
                ("TV", "showTv", ""),
+               ("TV" + " " + _("long"), "showTv_long", SystemInfo["LcdLiveTV"] and "Infobar/ToggleLCDLiveTV" or ""),
                ("Teletext", "text", ""),
                ("Help", "displayHelp", ""),
                ("Help" + " " + _("long"), "displayHelp_long", ""),
@@ -82,7 +84,7 @@ def getHotkeys():
                ("Power", "power", ""),
                ("Power" + " " + _("long"), "power_long", ""),
                ("HDMIin", "HDMIin", "Infobar/HDMIIn"),
-               ("HDMIin" + " " + _("long"), "HDMIin_long", SystemInfo["LcdLiveTV"] and "Infobar/ToggleLCDLiveTV" or "")]
+               ("HDMIin" + " " + _("long"), "HDMIin_long", "")]
 
 config.misc.hotkey = ConfigSubsection()
 config.misc.hotkey.additional_keys = ConfigYesNo(default=False)
@@ -152,7 +154,7 @@ def getHotkeyFunctions():
                hotkeyFunctions.append((_("Swap PIP"), "Infobar/swapPiP", "InfoBar"))
                hotkeyFunctions.append((_("Move PIP"), "Infobar/movePiP", "InfoBar"))
                hotkeyFunctions.append((_("Toggle PIPzap"), "Infobar/togglePipzap", "InfoBar"))
-       hotkeyFunctions.append((_("Activate HbbTV (Redbutton)"), "Infobar/activateRedButton", "InfoBar"))
+       hotkeyFunctions.append((_("Activate HbbTV (Redbutton)"), "Infobar/activateRedButton", "InfoBar"))               
        hotkeyFunctions.append((_("Toggle HDMI In"), "Infobar/HDMIIn", "InfoBar"))
        if SystemInfo["LcdLiveTV"]:
                hotkeyFunctions.append((_("Toggle LCD LiveTV"), "Infobar/ToggleLCDLiveTV", "InfoBar"))
@@ -328,7 +330,7 @@ class HotkeySetupSelect(Screen):
                self.prevselected = self.selected[:]
                self["choosen"] = ChoiceList(list=self.selected, selection=0)
                self["list"] = ChoiceList(list=self.getFunctionList(), selection=0)
-               self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "KeyboardInputActions", "MenuActions"],
+               self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "KeyboardInputActions", "MenuActions"], 
                {
                        "ok": self.keyOk,
                        "cancel": self.cancel,
@@ -538,7 +540,7 @@ class InfoBarHotkey():
                                pluginlist = plugins.getPlugins(PluginDescriptor.WHERE_EVENTINFO)
                                pluginlist.sort(key=lambda p: p.name)
                                for plugin in pluginlist:
-                                       if plugin.name not in twinPlugins and plugin.path and 'selectedevent' not in plugin.__call__.func_code.co_varnames:
+                                       if plugin.name not in twinPlugins and plugin.path and 'selectedevent' not in plugin.__call__.func_code.co_varnames:     
                                                if twinPaths.has_key(plugin.path[24:]):
                                                        twinPaths[plugin.path[24:]] += 1
                                                else: