1 # -*- coding: latin-1 -*-
3 from Components.Language import language
5 class NumericalTextInput:
6 def __init__(self, nextFunction = None):
8 self.lang = language.getLanguage()
10 if self.lang == 'de_DE':
11 self.mapping.append (".,?'\"0-()@/:_") # 0
12 self.mapping.append (" 1") # 1
13 self.mapping.append ("aäbc2AÄBC") # 2
14 self.mapping.append ("def3DEF") # 3
15 self.mapping.append ("ghi4GHI") # 4
16 self.mapping.append ("jkl5JKL") # 5
17 self.mapping.append ("mnoö6MNOÖ") # 6
18 self.mapping.append ("pqrsß7PQRSß") # 7
19 self.mapping.append ("tuüv8TUÜV") # 8
20 self.mapping.append ("wxyz9WXYZ") # 9
21 elif self.lang == 'es_ES':
22 self.mapping.append (".,?'\"0-()@/:_") # 0
23 self.mapping.append (" 1") # 1
24 self.mapping.append ("abcáà2ABCÁÀ") # 2
25 self.mapping.append ("deéèf3DEFÉÈ") # 3
26 self.mapping.append ("ghiíì4GHIÍÌ") # 4
27 self.mapping.append ("jkl5JKL") # 5
28 self.mapping.append ("mnñoóò6MNÑOÓÒ") # 6
29 self.mapping.append ("pqrs7PQRS") # 7
30 self.mapping.append ("tuvúù8TUVÚÙ") # 8
31 self.mapping.append ("wxyz9WXYZ") # 9
33 self.mapping.append (".,?'\"0-()@/:_") # 0
34 self.mapping.append (" 1") # 1
35 self.mapping.append ("abc2ABC") # 2
36 self.mapping.append ("def3DEF") # 3
37 self.mapping.append ("ghi4GHI") # 4
38 self.mapping.append ("jkl5JKL") # 5
39 self.mapping.append ("mno6MNO") # 6
40 self.mapping.append ("pqrs7PQRS") # 7
41 self.mapping.append ("tuv8TUV") # 8
42 self.mapping.append ("wxyz9WXYZ") # 9
44 self.nextFunction = nextFunction
46 self.Timer.timeout.get().append(self.nextChar)
50 def getKey(self, num):
52 self.Timer.start(1000)
53 if (self.lastKey != num):
58 if (len(self.mapping[num]) <= self.pos):
60 return self.mapping[num][self.pos]
71 if (self.nextFunction != None):