aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-12 00:30:28 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-12 00:30:28 +0000
commitff90cba66b3ebe6adf9b436fa8ae9ac440a0c70c (patch)
tree1a4326bbc2f9eafb0e1b53269cd2c15136f6109c /lib/python
parentad849952739d402553830c5ff080ac9a3edb3f4e (diff)
downloadenigma2-ff90cba66b3ebe6adf9b436fa8ae9ac440a0c70c.tar.gz
enigma2-ff90cba66b3ebe6adf9b436fa8ae9ac440a0c70c.zip
textinput works now except for the nextCharacter-thing
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/config.py6
-rw-r--r--lib/python/Tools/NumericalTextInput.py39
2 files changed, 33 insertions, 12 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index f2d45ef8..1486420c 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -298,13 +298,17 @@ class configText:
#this will no change anything on the value itself
#so we can handle it here in gui element
if key == config.key["prevElement"]:
+ self.textInput.nextKey()
self.markedPos -= 1
+
if key == config.key["nextElement"]:
+ self.textInput.nextKey()
self.markedPos += 1
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
diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py
index d867d74e..260f80b4 100644
--- a/lib/python/Tools/NumericalTextInput.py
+++ b/lib/python/Tools/NumericalTextInput.py
@@ -2,29 +2,46 @@ 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
+ mapping.append ("abcABC") # 0
+ mapping.append ("abcABC") # 1
+ mapping.append ("abcABC") # 2
+ mapping.append ("defDEF") # 3
+ mapping.append ("ghiGHI") # 4
+ mapping.append ("jklJKL") # 5
+ mapping.append ("mnoMNO") # 6
+ mapping.append ("pqrsPQRS") # 7
+ mapping.append ("tuvTUV") # 8
+ mapping.append ("wxyzWXYZ") # 9
+
+
def __init__(self, nextFunction):
self.nextFunction = nextFunction
self.Timer = eTimer()
self.Timer.timeout.get().append(self.nextChar)
+ self.lastKey = -1
+ self.pos = 0
def getKey(self, num):
+ self.Timer.stop()
self.Timer.start(1000)
- return self.mapping[num][0]
+ if (self.lastKey != num):
+ self.lastKey = num
+ self.pos = 0
+ else:
+ self.pos += 1
+ if (len(self.mapping[num]) <= self.pos):
+ self.pos = 0
+ return self.mapping[num][self.pos]
+
+ def nextKey(self):
+ self.Timer.stop()
+ self.lastKey = -1
def nextChar(self):
self.Timer.stop()
print "Timer done"
+ self.nextKey()
self.nextFunction()
\ No newline at end of file