X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6eeefece35e4269e02fdb7abab4f79d8e7b8f98b..98b800920d5ad05b854224bfa0ed0b18521788c4:/lib/python/Tools/NumericalTextInput.py diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py index 7c61d263..5954c9c3 100644 --- a/lib/python/Tools/NumericalTextInput.py +++ b/lib/python/Tools/NumericalTextInput.py @@ -1,4 +1,4 @@ -# -*- coding: latin-1 -*- +# -*- coding: iso-8859-1 -*- from enigma import eTimer from Components.Language import language @@ -10,7 +10,7 @@ class NumericalTextInput: self.nextFunction=nextFunc if self.lang == 'de_DE': - self.mapping.append (u".,?'\"0-()@/:_") # 0 + self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 self.mapping.append (u"aäbc2AÄBC") # 2 self.mapping.append (u"def3DEF") # 3 @@ -21,7 +21,7 @@ class NumericalTextInput: self.mapping.append (u"tuüv8TUÜV") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 elif self.lang == 'es_ES': - self.mapping.append (u".,?'\"0-()@/:_") # 0 + self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 self.mapping.append (u"abcáà2ABCÁÀ") # 2 self.mapping.append (u"deéèf3DEFÉÈ") # 3 @@ -31,8 +31,19 @@ class NumericalTextInput: self.mapping.append (u"pqrs7PQRS") # 7 self.mapping.append (u"tuvúù8TUVÚÙ") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 + if self.lang in ['sv_SE', 'fi_FI']: + self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 + self.mapping.append (u" 1") # 1 + self.mapping.append (u"abcåä2ABCÅÄ") # 2 + self.mapping.append (u"defé3DEFÉ") # 3 + self.mapping.append (u"ghi4GHI") # 4 + self.mapping.append (u"jkl5JKL") # 5 + self.mapping.append (u"mnoö6MNOÖ") # 6 + self.mapping.append (u"pqrs7PQRS") # 7 + self.mapping.append (u"tuv8TUV") # 8 + self.mapping.append (u"wxyz9WXYZ") # 9 else: - self.mapping.append (u".,?'\"0-()@/:_") # 0 + self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 self.mapping.append (u"abc2ABC") # 2 self.mapping.append (u"def3DEF") # 3 @@ -45,7 +56,7 @@ class NumericalTextInput: if handleTimeout: self.timer = eTimer() - self.timer.timeout.get().append(self.timeout) + self.timer.callback.append(self.timeout) else: self.timer = None self.lastKey = -1 @@ -56,11 +67,13 @@ class NumericalTextInput: def getKey(self, num): cnt=0 - if self.timer is not None: - self.timer.start(1000, True) if self.lastKey != num: + if self.lastKey != -1: + self.nextChar() self.lastKey = num self.pos = -1 + if self.timer is not None: + self.timer.start(1000, True) while True: self.pos += 1 if len(self.mapping[num]) <= self.pos: @@ -87,4 +100,5 @@ class NumericalTextInput: self.nextFunction() def timeout(self): - self.nextChar() + if self.lastKey != -1: + self.nextChar()