many keyboard improvements by Anders Holst
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 16 Dec 2007 20:24:17 +0000 (20:24 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 16 Dec 2007 20:24:17 +0000 (20:24 +0000)
data/keymap.xml
lib/python/Components/Input.py
lib/python/Screens/InputBox.py

index c10eec4e74377e6c68d6695d3000707a7010810d..f1ee889ef333a42625842447c7d487766e0d687e 100644 (file)
@@ -22,6 +22,8 @@
                <key id="KEY_RIGHT" mapto="moveRight" flags="mr" />
                <key id="KEY_HOME" mapto="moveHome" flags="mr" />
                <key id="KEY_END" mapto="moveEnd" flags="mr" />
+               <key id="KEY_BACK" mapto="moveHome" flags="mr" />
+               <key id="KEY_FORWARD" mapto="moveEnd" flags="mr" />
                <key id="KEY_DELETE" mapto="deleteForward" flags="mr" />
                <key id="KEY_BACKSPACE" mapto="deleteBackward" flags="mr" />
                <key id="KEY_TAB" mapto="tab" flags="mr" />
                <key id="KEY_RIGHT" mapto="right" flags="mr" />
                <key id="KEY_RED" mapto="cancel" flags="m" />
                <key id="KEY_GREEN" mapto="save" flags="m" />
-               <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
-               <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
-               <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               </device>
+               <device name="dreambox advanced remote control (native)">
+                       <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               </device>
                <key id="KEY_1" mapto="1" flags="m" />
                <key id="KEY_2" mapto="2" flags="m" />
                <key id="KEY_3" mapto="3" flags="m" />
        </map>
        
        <map context="InfobarInstantRecord">
-               <device name="dreambox remote control (native)">
-                       <key id="KEY_RED" mapto="instantRecord" flags="b" />
-               </device>
                <device name="dreambox advanced remote control (native)">
                        <key id="KEY_RECORD" mapto="instantRecord" flags="m" />
-                       <key id="KEY_STOP" mapto="instantRecord" flags="m" />
                </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_RECORD" mapto="instantRecord" flags="m" />
+               </device>
+               <key id="KEY_RED" mapto="instantRecord" flags="b" />
        </map>
 
        <map context="InfobarExtensions">
                <key id="KEY_DOWN" mapto="switchChannelDown" flags="mr" />
                <key id="KEY_PREVIOUS" mapto="historyBack" flags="mr" />
                <key id="KEY_NEXT" mapto="historyNext" flags="mr" />
+               <key id="KEY_BACK" mapto="historyBack" flags="mr" />
+               <key id="KEY_FORWARD" mapto="historyNext" flags="mr" />
                <key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />
                <key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />
                <key id="BTN_0" mapto="zapUp" flags="mr" />
                <key id="KEY_ENTER" mapto="ok" flags="m" />
                <key id="KEY_EXIT" mapto="back" flags="m" />
                <key id="KEY_ESC" mapto="back" flags="m" />
-               <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
-               <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
-               <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               </device>
+               <device name="dreambox advanced remote control (native)">
+                       <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               </device>
                <key id="KEY_1" mapto="1" flags="m" />
                <key id="KEY_2" mapto="2" flags="m" />
                <key id="KEY_3" mapto="3" flags="m" />
                <device name="dreambox remote control (native)">
                        <key id="KEY_AUDIO" mapto="audioSelection" flags="m" />
                </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_AUDIO" mapto="audioSelection" flags="m" />
+               </device>
                <device name="dreambox advanced remote control (native)">
                        <key id="KEY_YELLOW" mapto="audioSelection" flags="m" />
                </device>
        <map context="InfobarSubserviceQuickzapActions">
                <key id="KEY_PREVIOUS" mapto="prevSubservice" flags="m" />
                <key id="KEY_NEXT" mapto="nextSubservice" flags="m" />
+               <key id="KEY_BACK" mapto="prevSubservice" flags="m" />
+               <key id="KEY_FORWARD" mapto="nextSubservice" flags="m" />
                <key id="KEY_EXIT" mapto="exit" flags="m" />
-               <key id="KEY_TV" mapto="exit" flags="m" />
+               <key id="KEY_ESC" mapto="exit" flags="m" />
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_TV" mapto="exit" flags="m" />
+               </device>
        </map>
 
        <map context="GlobalActions">
        </map>
 
        <map context="TextEntryActions">
-               <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
-               <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
-               <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               </device>
+               <device name="dreambox advanced remote control (native)">
+                       <key id="KEY_MUTE" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
+                       <key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
+               </device>
        </map>  
 
        <map context="InfobarSeekActions">
                        <key id="KEY_BLUE" mapto="seekFwdManual" flags="l" />
                </device>
                <device name="dreambox advanced remote control (native)">
-                       <key id="KEY_PLAY" mapto="playpauseService" flags="m" />
-                       <!--key id="KEY_GREEN" mapto="unPauseService" flags="m" /-->
+                       <key id="KEY_PLAYPAUSE" mapto="playpauseService" flags="m" />
                        <key id="KEY_PREVIOUSSONG" mapto="seekBack" flags="b" />
                        <key id="KEY_NEXTSONG" mapto="seekFwd" flags="b" />
                        <key id="KEY_PREVIOUSSONG" mapto="seekBackManual" flags="l" />
                        <key id="KEY_NEXTSONG" mapto="seekFwdManual" flags="l" />
                </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_PAUSE" mapto="pauseService" flags="m" />
+                       <key id="KEY_PLAY" mapto="playpauseService" flags="m" />
+                       <key id="KEY_REWIND" mapto="seekBack" flags="b" />
+                       <key id="KEY_FASTFORWARD" mapto="seekFwd" flags="b" />
+                       <key id="KEY_REWIND" mapto="seekBackManual" flags="l" />
+                       <key id="KEY_FASTFORWARD" mapto="seekFwdManual" flags="l" />
+               </device>
                
                <key id="KEY_LEFT" mapto="seekBack" flags="m" />
                <key id="KEY_RIGHT" mapto="seekFwd" flags="m" />
                        <key id="KEY_PREVIOUSSONG" mapto="seekBackManual" flags="l" />
                        <key id="KEY_NEXTSONG" mapto="seekFwdManual" flags="l" />
                </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_REWIND" mapto="seekBack" flags="b" />
+                       <key id="KEY_FASTFORWARD" mapto="seekFwd" flags="b" />
+                       <key id="KEY_REWIND" mapto="seekBackManual" flags="l" />
+                       <key id="KEY_FASTFORWARD" mapto="seekFwdManual" flags="l" />
+               </device>
                
-               <key id="KEY_1" mapto="seek:-15" flags="m" />
-               <key id="KEY_3" mapto="seek:15" flags="m" />
+               <key id="KEY_1" mapto="seek:-15" flags="b" />
+               <key id="KEY_3" mapto="seek:15" flags="b" />
                <key id="KEY_1" mapto="seekBackDef" flags="l" />
                <key id="KEY_3" mapto="seekFwdDef" flags="l" />
                <key id="KEY_4" mapto="seek:-60" flags="m" />
 
        <map context="InfobarTimeshiftActions">
                <device name="dreambox remote control (native)">
-                       <key id="KEY_YELLOW" mapto="timeshiftStart" flags="m" />
                        <key id="KEY_TV" mapto="timeshiftStop" flags="m" />
                </device>
                <device name="dreambox advanced remote control (native)">
-                       <key id="KEY_PLAY" mapto="timeshiftStart" flags="m" />
+                       <key id="KEY_PLAYPAUSE" mapto="timeshiftStart" flags="m" />
+                       <key id="KEY_STOP" mapto="timeshiftStop" flags="m" />
+               </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_PAUSE" mapto="timeshiftStart" flags="m" />
                        <key id="KEY_STOP" mapto="timeshiftStop" flags="m" />
                </device>
+               <key id="KEY_YELLOW" mapto="timeshiftStart" flags="m" />
        </map>
 
        <map context="InfobarTimeshiftActivateActions">
                </device>
                <device name="dreambox advanced remote control (native)">
                        <key id="KEY_PREVIOUSSONG" mapto="timeshiftActivateEnd" flags="m" />
-                       <key id="KEY_PLAY" mapto="timeshiftActivateEndAndPause" flags="m" />
+                       <key id="KEY_PLAYPAUSE" mapto="timeshiftActivateEndAndPause" flags="m" />
+               </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_REWIND" mapto="timeshiftActivateEnd" flags="m" />
+                       <key id="KEY_PAUSE" mapto="timeshiftActivateEndAndPause" flags="m" />
                </device>
        </map>
 
        </map>
 
        <map context="MoviePlayerActions">
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_TV" mapto="leavePlayer" flags="m" />
+               </device>
                <device name="dreambox advanced remote control (native)">
                        <key id="KEY_STOP" mapto="leavePlayer" flags="m" />
                </device>
-               <key id="KEY_TV" mapto="leavePlayer" flags="m" />
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_STOP" mapto="leavePlayer" flags="m" />
+               </device>
        </map>
        
        <map context="InfobarCueSheetActions">
                <device name="dreambox remote control (native)">
                        <key id="KEY_PREVIOUS" mapto="jumpPreviousMark" flags="m" />
                        <key id="KEY_NEXT" mapto="jumpNextMark" flags="m" />
-                       <key id="KEY_PREVIOUSSONG" mapto="jumpPreviousMark" flags="m" />
-                       <key id="KEY_PLAYPAUSE" mapto="toggleMark" flags="m" />
-                       <key id="KEY_NEXTSONG" mapto="jumpNextMark" flags="m" />
+                       <key id="KEY_0" mapto="toggleMark" flags="m" />
                </device>
                <device name="dreambox advanced remote control (native)">
-                       <key id="KEY_RED" mapto="jumpPreviousMark" flags="m" />
-                       <key id="KEY_YELLOW" mapto="toggleMark" flags="m" />
-                       <key id="KEY_BLUE" mapto="jumpNextMark" flags="m" />
+                       <key id="KEY_PREVIOUS" mapto="jumpPreviousMark" flags="m" />
+                       <key id="KEY_0" mapto="toggleMark" flags="m" />
+                       <key id="KEY_NEXT" mapto="jumpNextMark" flags="m" />
+               </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_PREVIOUSSONG" mapto="jumpPreviousMark" flags="m" />
+                       <key id="KEY_TAB" mapto="toggleMark" flags="m" />
+                       <key id="KEY_NEXTSONG" mapto="jumpNextMark" flags="m" />
                </device>
        </map>
        
        <map context="MediaPlayerCueSheetActions">
                <device name="dreambox remote control (native)">
-                       <key id="KEY_PREVIOUSSONG" mapto="jumpPreviousMark" flags="m" />
-                       <key id="KEY_PLAYPAUSE" mapto="toggleMark" flags="m" />
-                       <key id="KEY_NEXTSONG" mapto="jumpNextMark" flags="m" />
+                       <key id="KEY_PREVIOUS" mapto="jumpPreviousMark" flags="b" />
+                       <key id="KEY_NEXT" mapto="jumpNextMark" flags="b" />
+                       <key id="KEY_0" mapto="toggleMark" flags="m" />
                </device>
                <device name="dreambox advanced remote control (native)">
-                       <key id="KEY_RED" mapto="jumpPreviousMark" flags="m" />
-                       <key id="KEY_YELLOW" mapto="toggleMark" flags="m" />
-                       <key id="KEY_BLUE" mapto="jumpNextMark" flags="m" />
+                       <key id="KEY_PREVIOUS" mapto="jumpPreviousMark" flags="b" />
+                       <key id="KEY_0" mapto="toggleMark" flags="m" />
+                       <key id="KEY_NEXT" mapto="jumpNextMark" flags="b" />
+               </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_PREVIOUSSONG" mapto="jumpPreviousMark" flags="b" />
+                       <key id="KEY_TAB" mapto="toggleMark" flags="m" />
+                       <key id="KEY_NEXTSONG" mapto="jumpNextMark" flags="b" />
                </device>
        </map>
        
                <key id="KEY_UP" mapto="prevPage" flags="mr" />
                <key id="KEY_DOWN" mapto="nextPage" flags="mr" />
                <key id="KEY_EXIT" mapto="exit" flags="m" />
+               <key id="KEY_ESC" mapto="exit" flags="m" />
        </map>
 
        <map context="ChannelSelectBaseActions">
                <key id="KEY_CHANNELDOWN" mapto="prevBouquet" flags="m" />
                <key id="KEY_PREVIOUS" mapto="prevMarker" flags="m" />
                <key id="KEY_NEXT" mapto="nextMarker" flags="m" />
+               <key id="KEY_BACK" mapto="prevMarker" flags="m" />
+               <key id="KEY_FORWARD" mapto="nextMarker" flags="m" />
        </map>
 
        <map context="ChannelSelectEPGActions">
        
        <map context="SleepTimerEditorActions">
                <key id="KEY_OK" mapto="select" flags="m" />
+               <key id="KEY_ENTER" mapto="select" flags="m" />
                <key id="KEY_EXIT" mapto="exit" flags="m" />
+               <key id="KEY_ESC" mapto="exit" flags="m" />
                <key id="KEY_1" mapto="1" flags="m" />
                <key id="KEY_2" mapto="2" flags="m" />
                <key id="KEY_3" mapto="3" flags="m" />
                <key id="KEY_YELLOW" mapto="toggleAsk" flags="mr" />
                <key id="KEY_GREEN" mapto="toggleAction" flags="mr" />
                <!--key id="KEY_BLUE" mapto="settings" flags="mr" /-->
-               
        </map>  
        
        <map context="CiSelectionActions">
                <device name="dreambox remote control (native)">
                        <key id="KEY_YELLOW" mapto="pause" flags="m" />
                        <key id="KEY_GREEN" mapto="play" flags="m" />
+                       <key id="KEY_TV" mapto="stop" flags="b" />
+                       <key id="KEY_TV" mapto="shift_stop" flags="l" />
+                       <key id="KEY_RADIO" mapto="shift_record" flags="l" />
+                       <key id="KEY_PREVIOUS" mapto="previous" flags="l" />
+                       <key id="KEY_NEXT" mapto="next" flags="l" />
                </device>
                <device name="dreambox advanced remote control (native)">
                        <key id="KEY_PLAYPAUSE" mapto="pause" flags="m" />
-                       <key id="KEY_STOP" mapto="stop" flags="m" />
-                       <!--key id="KEY_GREEN" mapto="play" flags="m" /-->
+                       <key id="KEY_STOP" mapto="stop" flags="b" />
+                       <key id="KEY_STOP" mapto="shift_stop" flags="l" />
+                       <key id="KEY_RECORD" mapto="shift_record" flags="l" />
+                       <key id="KEY_PREVIOUS" mapto="previous" flags="l" />
+                       <key id="KEY_NEXT" mapto="next" flags="l" />
+               </device>
+               <device name="dreambox ir keyboard">
+                       <key id="KEY_PAUSE" mapto="pause" flags="m" />
+                       <key id="KEY_PLAY" mapto="play" flags="m" />
+                       <key id="KEY_STOP" mapto="stop" flags="b" />
+                       <key id="KEY_STOP" mapto="shift_stop" flags="l" />
+                       <key id="KEY_RECORD" mapto="shift_record" flags="l" />
+                       <key id="KEY_PREVIOUSSONG" mapto="previous" flags="l" />
+                       <key id="KEY_NEXTSONG" mapto="next" flags="l" />
                </device>
-               
-               <key id="KEY_TV" mapto="stop" flags="m" />
-
-               <key id="KEY_PREVIOUS" mapto="previous" flags="mr" />
-               <key id="KEY_NEXT" mapto="next" flags="mr" />
                
                <key id="KEY_MENU" mapto="menu" flags="m" />
 
-               <key id="KEY_0" mapto="skipListbegin" flags="m" />
+               <key id="KEY_2" mapto="skipListbegin" flags="m" />
                <key id="KEY_8" mapto="skipListend" flags="m" />
                <key id="KEY_CHANNELUP" mapto="nextBouquet" flags="m" />
                <key id="KEY_CHANNELDOWN" mapto="prevBouquet" flags="m" />
                <key id="KEY_VIDEO" mapto="delete" flags="m" />
-               <key id="KEY_STOP" mapto="shift_stop" flags="m" />
-               <key id="KEY_RECORD" mapto="shift_record" flags="m" />
        </map>
 </keymap>
index 64ffdf4ff1ac2b81975739102947f8229687a2ef..3c09ab9fe459ec066755020b00da2caa4392eb6a 100644 (file)
@@ -82,9 +82,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                s = self.instance.calculateSize()
                return (s.width(), s.height())
        
-       def right(self):
-               if self.type == self.TEXT:
-                       self.timeout()
+       def innerright(self):
                if self.allmarked:
                        self.currPos = 0
                        self.allmarked = False
@@ -94,6 +92,11 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                else:
                        if self.currPos < len(self.Text):
                                self.currPos += 1
+
+       def right(self):
+               if self.type == self.TEXT:
+                       self.timeout()
+               self.innerright()
                self.update()
 
        def left(self):
@@ -181,7 +184,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                        self.allmarked = False
                else:
                        self.insertChar(" ", self.currPos, False, True);
-                       self.currPos += 1
+                       self.innerright()
                self.update()
 
        def delete(self):
@@ -193,7 +196,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                else:
                        self.deleteChar(self.currPos);
                        if self.maxSize and self.overwrite:
-                               self.currPos += 1
+                               self.innerright()
                self.update()
 
        def deleteBackward(self):
@@ -223,7 +226,8 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                        self.deleteAllChars()
                        self.allmarked = False
                self.insertChar(unichr(code), self.currPos, False, False);
-               self.right()
+               self.innerright()
+               self.update()
 
        def number(self, number):
                if self.type == self.TEXT:
@@ -237,5 +241,5 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                        self.allmarked = False
                self.insertChar(newChar, self.currPos, owr, False);
                if self.type == self.PIN or self.type == self.NUMBER:
-                       self.right()
+                       self.innerright()
                self.update()
index 55334d2f7f2c00e6dd38920b8bb0a770fffb3135..fe21ea0ab5136185f7d2d0b4c5dcb5020584dcc0 100644 (file)
@@ -108,6 +108,13 @@ class PinInput(InputBox):
                self["tries"] = Label("")
                self.onShown.append(self.showTries)
 
+       def gotAsciiCode(self):
+               if self["input"].currPos == len(self["input"]) - 1:
+                       InputBox.gotAsciiCode(self)
+                       self.go()
+               else:
+                       InputBox.gotAsciiCode(self)
+
        def keyNumberGlobal(self, number):
                if self["input"].currPos == len(self["input"]) - 1:
                        InputBox.keyNumberGlobal(self, number)