update de language
[enigma2.git] / lib / python / Screens / InputBox.py
index 6771a517d70aa9471f0db440b8a46cd295e5c0ac..558cbc01bac7dd2b3b67c2e4c6797443783de85d 100644 (file)
@@ -14,13 +14,24 @@ class InputBox(Screen):
 
                self["text"] = Label(title)
                self["input"] = Input(**kwargs)
-                               
-               self["actions"] = NumberActionMap(["WizardActions", "InputActions"], 
+
+               self["actions"] = NumberActionMap(["WizardActions", "InputBoxActions", "InputAsciiActions", "KeyboardInputActions"], 
                {
+                       "gotAsciiCode": self.gotAsciiCode,
                        "ok": self.go,
-                       "back": self.close,
+                       "back": self.cancel,
                        "left": self.keyLeft,
                        "right": self.keyRight,
+                       "delete": self.keyDelete,
+                       "moveLeft": self.keyLeft,
+                       "moveRight": self.keyRight,
+                       "moveHome": self.keyHome,
+                       "moveEnd": self.keyEnd,
+                       "deleteForward": self.keyDelete,
+                       "deleteBackward": self.keyBackspace,
+                       "tab": self.keyTab,
+                       "toggleOverwrite": self.keyInsert,
+                       "accept": self.go,
                        "1": self.keyNumberGlobal,
                        "2": self.keyNumberGlobal,
                        "3": self.keyNumberGlobal,
@@ -32,19 +43,45 @@ class InputBox(Screen):
                        "9": self.keyNumberGlobal,
                        "0": self.keyNumberGlobal
                }, -1)
-               
+               rcinput = eRCInput.getInstance()
+               rcinput.setKeyboardMode(rcinput.kmAscii)
+
+       def gotAsciiCode(self):
+               self["input"].handleAscii(getPrevAsciiCode())
+
        def keyLeft(self):
                self["input"].left()
-       
+
        def keyRight(self):
                self["input"].right()
-       
+
        def keyNumberGlobal(self, number):
-               print "pressed", number
                self["input"].number(number)
-               
+
+       def keyDelete(self):
+               self["input"].delete()
+
        def go(self):
+               rcinput = eRCInput.getInstance()
+               rcinput.setKeyboardMode(rcinput.kmNone)
                self.close(self["input"].getText())
-               
+
        def cancel(self):
-               self.close(None)
\ No newline at end of file
+               rcinput = eRCInput.getInstance()
+               rcinput.setKeyboardMode(rcinput.kmNone)
+               self.close(None)
+
+       def keyHome(self):
+               self["input"].home()
+
+       def keyEnd(self):
+               self["input"].end()
+
+       def keyBackspace(self):
+               self["input"].deleteBackward()
+
+       def keyTab(self):
+               self["input"].tab()
+
+       def keyInsert(self):
+               self["input"].toggleOverwrite()