Example #1
0
    def keyGotAscii(self):
        #char = str(unichr(getPrevAsciiCode()).encode('utf-8'))
        from Components.config import getCharValue
        char = getCharValue(getPrevAsciiCode())
        if len(str(char)) == 1:
            char = char.encode("utf-8")
        if self.inShiftKeyList(char):
            self.shiftMode = True
            list = self.shiftkeys_list
        else:
            self.shiftMode = False
            list = self.keys_list

        if char == " ":
            char = "SPACE"

        selkey = 0
        for keylist in list:
            for key in keylist:
                if key == char:
                    self.selectedKey = selkey
                    self.okClicked()
                    self.showActiveKey()
                    return
                else:
                    selkey += 1
Example #2
0
	def keyGotAscii(self):
		try:
			from Components.config import getCharValue
			char = getCharValue(getPrevAsciiCode())
		except:
			char = unichr(getPrevAsciiCode())
		if len(str(char)) == 1:
			char = char.encode("utf-8")
		if self.inShiftKeyList(char):
			self.shiftMode = True
			list = self.shiftkeys_list
		else:
			self.shiftMode = False
			list = self.keys_list
		if char == " ":
			char = "SPACE"
		selkey = 0
		for keylist in list:
			for key in keylist:
				if key == char:
					self.selectedKey = selkey
					self.okClicked()
					self.showActiveKey()
					return
				else:
					selkey += 1
Example #3
0
	def handleAscii(self, code):
		if self.type == self.TEXT:
			self.timeout()
		if self.allmarked:
			self.deleteAllChars()
			self.allmarked = False
		#self.insertChar(unichr(code), self.currPos, False, False);
		from Components.config import getCharValue
		newcode = getCharValue(code)
		if newcode is None:
			return
		self.insertChar(newcode, self.currPos, False, False);
		self.innerright()
		self.update()