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,
"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()