def addToMainText(self, keycode, char, upDown): if upDown == DOWN: messages.hide() if char != "": if self.left_shift == DOWN or self.right_shift == DOWN: char = archy_globals.apply_shift_key_to_character(char) addToText(char)
def getPossibleMatchingChars(char): if char.islower(): return (char, char.upper()) else: shiftedChar = archy_globals.apply_shift_key_to_character(char) if shiftedChar <> char: return (char, shiftedChar) return (char)
def getPossibleMatchingChars(char): if char.islower(): return (char, char.upper()) else: shiftedChar = archy_globals.apply_shift_key_to_character(char) if shiftedChar <> char: return (char, shiftedChar) return char
def keypress(self, keycode, unicode, action): if action == DOWN: if unicode == u"": return if self.parent.left_shift == DOWN or self.parent.right_shift == DOWN: unicode = archy_globals.apply_shift_key_to_character(unicode) messages.addToMessage(unicode, 'leap') try: self.leapCommand.addChar(unicode) if self.leapCommand.status() == 0: # I do not think an addChar can result in a 0 length target but # it will not hurt to check here. -Han self.restoreViewSettings() except commands.AbortCommandException, e: self.info = e.getExplanation() self.restoreViewSettings() self.playFailedLeapSound()
def doKey(self, keystroke, event): if type(keystroke) == int: keyValue = keystroke keystroke = '' else: keyValue = ord(keystroke) if event == "press": is_upper = archy_globals.apply_shift_key_to_character(keystroke) == keystroke if is_upper: archyState.keyState.right_shift = 'down' archyState.keyState.keypress(keyValue, keystroke, "down") archyState.keyState.keypress(keyValue, keystroke, "up") if is_upper: archyState.keyState.right_shift = 'up' elif event == "down" or event == "up": archyState.keyState.keypress(keyValue, keystroke, event)
def doKey(self, keystroke, event): keyboard.show(keystroke) if type(keystroke) == int: keyValue = keystroke keystroke = '' else: keyValue = ord(keystroke) if event == "press": is_upper = archy_globals.apply_shift_key_to_character( keystroke) == keystroke if is_upper: archyState.keyState.right_shift = 'down' self.sound.stop() self.sound.play() if keyboard.isModifier(keyValue): keyboard.addModifier(keyValue) archyState.keyState.keypress(keyValue, keystroke, "down") archyState.keyState.keypress(keyValue, keystroke, "up") if is_upper: archyState.keyState.right_shift = 'up' elif event == "_unpress": keyboard.show('') if keyboard.isModifier(keyValue): keyboard.unshowLeap() elif event == "show": keyboard.addModifier(keyValue) elif event == "unshow": keyboard.removeModifier(keyValue) elif event == "down" or event == "up": archyState.keyState.keypress(keyValue, keystroke, event) if event == "down": keyboard.addModifier(keyValue) self.sound.stop() self.sound.play() if event == "up": keyboard.removeModifier(keyValue)
def doKey(self, keystroke, event): keyboard.show(keystroke) if type(keystroke) == int: keyValue = keystroke keystroke = '' else: keyValue = ord(keystroke) if event == "press": is_upper = archy_globals.apply_shift_key_to_character(keystroke) == keystroke if is_upper: archyState.keyState.right_shift = 'down' self.sound.stop() self.sound.play() if keyboard.isModifier(keyValue): keyboard.addModifier(keyValue) archyState.keyState.keypress(keyValue, keystroke, "down") archyState.keyState.keypress(keyValue, keystroke, "up") if is_upper: archyState.keyState.right_shift = 'up' elif event == "_unpress": keyboard.show('') if keyboard.isModifier(keyValue): keyboard.unshowLeap() elif event == "show": keyboard.addModifier(keyValue) elif event == "unshow": keyboard.removeModifier(keyValue) elif event == "down" or event == "up": archyState.keyState.keypress(keyValue, keystroke, event) if event == "down": keyboard.addModifier(keyValue) self.sound.stop() self.sound.play() if event == "up": keyboard.removeModifier(keyValue)