diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-11-11 23:57:30 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-11-11 23:57:30 +0000 |
| commit | ad849952739d402553830c5ff080ac9a3edb3f4e (patch) | |
| tree | e5da8081a450c6d8efe7a9325f2a62c1001954cd /lib/python | |
| parent | 7b9d3432c8b671621bba5803a0e44cb295f7f6f8 (diff) | |
| download | enigma2-ad849952739d402553830c5ff080ac9a3edb3f4e.tar.gz enigma2-ad849952739d402553830c5ff080ac9a3edb3f4e.zip | |
mobile phone like text input (doesn't update the configList... why?)
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/config.py | 11 | ||||
| -rw-r--r-- | lib/python/Tools/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Tools/NumericalTextInput.py | 30 |
3 files changed, 39 insertions, 4 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 75dee0ce..f2d45ef8 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1,4 +1,5 @@ from time import * +from Tools.NumericalTextInput import * class configFile: def __init__(self): @@ -275,6 +276,7 @@ class configText: self.parent = parent self.markedPos = 0 self.mode = self.parent.vals[0] + self.textInput = NumericalTextInput(self.nextEntry) def checkValues(self): if (self.markedPos < 0): @@ -287,6 +289,10 @@ class configText: def save(self): self.parent.save() + + def nextEntry(self): + print "Next entry" + self.handleKey(config.key["nextElement"]) def handleKey(self, key): #this will no change anything on the value itself @@ -298,12 +304,11 @@ class configText: if (self.mode == self.extendableSize): if (self.markedPos >= len(self.parent.value)): self.parent.value = self.parent.value.ljust(len(self.parent.value) + 1) - - + if key >= config.key["0"] and key <= config.key["9"]: number = 9 - config.key["9"] + key - self.parent.value = self.parent.value[0:self.markedPos] + str(number) + self.parent.value[self.markedPos + 1:] + self.parent.value = self.parent.value[0:self.markedPos] + str(self.textInput.getKey(number)) + self.parent.value[self.markedPos + 1:] self.checkValues() diff --git a/lib/python/Tools/Makefile.am b/lib/python/Tools/Makefile.am index 882e523e..d9bd45a2 100644 --- a/lib/python/Tools/Makefile.am +++ b/lib/python/Tools/Makefile.am @@ -1,4 +1,4 @@ installdir = $(LIBDIR)/enigma2/python/Tools install_DATA = \ - FuzzyDate.py XMLTools.py Directories.py __init__.py + FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py __init__.py diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py new file mode 100644 index 00000000..d867d74e --- /dev/null +++ b/lib/python/Tools/NumericalTextInput.py @@ -0,0 +1,30 @@ +from enigma import * + +class NumericalTextInput: + mapping = [] + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 0 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 1 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 2 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 3 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 4 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 5 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 6 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 7 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 8 + mapping.append (('a', 'b', 'c', 'A', 'B', 'C')) # 9 + + + def __init__(self, nextFunction): + self.nextFunction = nextFunction + self.Timer = eTimer() + self.Timer.timeout.get().append(self.nextChar) + + def getKey(self, num): + self.Timer.start(1000) + return self.mapping[num][0] + + def nextChar(self): + self.Timer.stop() + print "Timer done" + self.nextFunction() +
\ No newline at end of file |
