- add shortcuts
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 19 May 2005 22:55:45 +0000 (22:55 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 19 May 2005 22:55:45 +0000 (22:55 +0000)
 - shortcuts are used for focus in TimerEdit (sucks yet)

keymap.xml
lib/python/Screens/TimerEdit.py

index e4e51ea..fa7cd6e 100644 (file)
@@ -27,6 +27,8 @@
                <key id="KEY_END" mapto="moveEnd" flags="mr" />
                <key id="KEY_DELETE" mapto="deleteForward" flags="mr" />
                <key id="KEY_BACKSPACE" mapto="deleteBackward" flags="mr" />
+               
+               <key id="KEY_INSERT" mapto="toggleOverwrite" flags="m" />
        </map>
 
        <map context="InfobarActions">
        <map context="WindowActions">
                
        </map>
+       
+       <map context="ShortcutActions">
+               <key id="KEY_F1" mapto="red" flags="mr" />
+               <key id="KEY_F2" mapto="yellow" flags="mr" />
+               <key id="KEY_F3" mapto="green" flags="mr" />
+               <key id="KEY_F4" mapto="blue" flags="mr" />
+
+               <key id="KEY_RED" mapto="red" flags="mr" />
+               <key id="KEY_YELLOW" mapto="yellow" flags="mr" />
+               <key id="KEY_GREEN" mapto="green" flags="mr" />
+               <key id="KEY_BLUE" mapto="blue" flags="mr" />
+       </map>
 </keymap>
index 41b6a12..2fe389e 100644 (file)
@@ -15,6 +15,12 @@ class TimerEdit(Screen):
                                "cancel": self.close
                        })
                
+               self["shortcuts"] = ActionMap(["ShortcutActions"],
+                       {
+                               "red": self.beginFocus,
+                               "yellow": self.endFocus
+                       })
+               
                self.entry = entry
                # begin, end, description, service
                self["begin"] = TimeInput()
@@ -28,6 +34,12 @@ class TimerEdit(Screen):
                self["apply"] = Button("Apply")
                self["service"] = Button()
        
+       def beginFocus(self):
+               self.setFocus(self["begin"])
+       
+       def endFocus(self):
+               self.setFocus(self["end"])
+       
        def apply(self):
                print "applied!"