From fce04ebed510a97e17f019a35c327dce78b6d916 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Wed, 7 Jun 2006 15:31:51 +0000 Subject: more work on keyboard support --- lib/python/Components/Input.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py index 0bd13059..311e42a9 100644 --- a/lib/python/Components/Input.py +++ b/lib/python/Components/Input.py @@ -50,8 +50,9 @@ class Input(VariableText, HTMLComponent, GUIComponent): self.update() def left(self): - self.currPos -= 1 - self.update() + if self.currPos > 0: + self.currPos -= 1 + self.update() def up(self): if self.text[self.currPos] == "9" or self.text[self.currPos] == " ": @@ -73,7 +74,13 @@ class Input(VariableText, HTMLComponent, GUIComponent): def delete(self): self.text = self.text[:self.currPos] + self.text[self.currPos + 1:] self.update() - + + def handleAscii(self, code): + newChar = chr(code) + self.text = self.text[0:self.currPos] + newChar + self.text[self.currPos + 1:] + self.right() + self.update() + def number(self, number): if self.type == self.TEXT: newChar = self.numericalTextInput.getKey(number) -- cgit v1.2.3