from time import *
+from Tools.NumericalTextInput import *
class configFile:
def __init__(self):
self.parent = parent
self.markedPos = 0
self.mode = self.parent.vals[0]
+ self.textInput = NumericalTextInput(self.nextEntry)
def checkValues(self):
if (self.markedPos < 0):
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
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()
--- /dev/null
+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