def handleKey(self, key): if key in KEY_NUMBERS or key == KEY_ASCII: if key == KEY_ASCII: owr = False ascii = getPrevAsciiCode() if not 48 <= ascii <= 57 or not 65 <= ascii <= 70 or not 97 <= ascii <= 102: return newChar = unichr(ascii) else: owr = self.lastKey == getKeyNumber(key) newChar = self.getKey(getKeyNumber(key)) if self.allmarked: self.text = '0' * self.size self.allmarked = False self.marked_pos = 0 self.insertChar(newChar, self.marked_pos, True) else: ConfigText.handleKey(self, key) self.conform()
def handleKey(self, key): if key in KEY_NUMBERS or key == KEY_ASCII: if key == KEY_ASCII: owr = False ascii = getPrevAsciiCode() if not (48 <= ascii <= 57) or not(65 <= ascii <= 70) or not(97 <= ascii <= 102): return newChar = unichr(ascii) else: owr = self.lastKey == getKeyNumber(key) newChar = self.getKey(getKeyNumber(key)) if self.allmarked: self.text = "0" * self.size self.allmarked = False self.marked_pos = 0 self.insertChar(newChar, self.marked_pos, True) else: ConfigText.handleKey(self, key) self.conform()