diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-06-29 22:58:04 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-06-29 22:58:04 +0000 |
| commit | 9c2be7b98291ced0479a737f9141ed6d64eaed3a (patch) | |
| tree | d32c0d40a138941ccd47cd07af3d979063644ea3 /lib/python/Components | |
| parent | 2b0cb23445858adf81b34500883c842ffd26f4f8 (diff) | |
| download | enigma2-9c2be7b98291ced0479a737f9141ed6d64eaed3a.tar.gz enigma2-9c2be7b98291ced0479a737f9141ed6d64eaed3a.zip | |
some keyboard fixes (thanks to luke_s)
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Input.py | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py index e6e27fab..b140ef51 100644 --- a/lib/python/Components/Input.py +++ b/lib/python/Components/Input.py @@ -19,8 +19,8 @@ class Input(VariableText, HTMLComponent, GUIComponent): self.maxSize = maxSize self.currPos = 0 self.Text = text + self.overwrite = 0 self.update() - def update(self): self.setMarkedPos(self.currPos) if self.type == self.PIN: @@ -79,14 +79,45 @@ class Input(VariableText, HTMLComponent, GUIComponent): newNumber = str(int(self.Text[self.currPos]) - 1) self.Text = self.Text[0:self.currPos] + newNumber + self.Text[self.currPos + 1:] self.update() - + + def home(self): + self.currPos = 0 + self.update() + + def end(self): + self.currPos = len(self.Text) - 1 + self.update() + + def tab(self): + if self.currPos == len(self.Text) - 1: + self.Text=self.Text+ " " + self.end() + else: + self.Text = self.Text[0:self.currPos] + " " + self.Text[self.currPos:] + self.update() + def delete(self): self.Text = self.Text[:self.currPos] + self.Text[self.currPos + 1:] self.update() + + def toggleOverwrite(self): + if self.overwrite==1: + self.overwrite=0 + else: + self.overwrite=1 + self.update() + + def deleteBackward(self): + self.Text = self.Text[:self.currPos - 1] + self.Text[self.currPos:] + self.left() + self.update() def handleAscii(self, code): newChar = chr(code) - self.Text = self.Text[0:self.currPos] + newChar + self.Text[self.currPos + 1:] + if self.overwrite==1: + self.Text = self.Text[0:self.currPos] + newChar + self.Text[self.currPos + 1:] + else: + self.Text = self.Text[0:self.currPos] + newChar + self.Text[self.currPos:] self.right() def number(self, number): |
