Beispiel #1
0
def inkey_from_tk_event(event, auto_shift=True):
    if event.keysym_num>64000: # FIXME: Found a boundary number
        inkey=event.keysym
    else:
        inkey=event.char
        if auto_shift:
            inkey = invert_shift(inkey)
    return inkey
Beispiel #2
0
def inkey_from_tk_event(event, auto_shift=True):
    if event.keysym_num > 64000:  # FIXME: Found a boundary number
        inkey = event.keysym
    else:
        inkey = event.char
        if auto_shift:
            inkey = invert_shift(inkey)
    return inkey
Beispiel #3
0
    def event_text_key(self, event):
        """
        So a "invert shift" for user inputs:
        Convert all lowercase letters to uppercase and vice versa.
        """
        char = event.char
        if not char or char not in string.ascii_letters:
            # ignore all non letter inputs
            return

        converted_char = invert_shift(char)
        log.debug("convert keycode %s - char %s to %s", event.keycode, repr(char), converted_char)
#         self.text.delete(Tkinter.INSERT + "-1c") # Delete last input char
        self.text.insert(tkinter.INSERT, converted_char) # Insert converted char
        return "break"
Beispiel #4
0
    def event_key_pressed(self, event):
        """
        So a "invert shift" for user inputs:
        Convert all lowercase letters to uppercase and vice versa.
        """
        char = event.char
        if not char:
            return

        if char in string.ascii_letters:
            char = invert_shift(char)

        self.user_input_queue.put(char)

        # Don't insert the char in text widget, because it will be echoed
        # back from the machine!
        return "break"
Beispiel #5
0
    def event_text_key(self, event):
        """
        So a "invert shift" for user inputs:
        Convert all lowercase letters to uppercase and vice versa.
        """
        char = event.char
        if not char or char not in string.ascii_letters:
            # ignore all non letter inputs
            return

        converted_char = invert_shift(char)
        log.debug("convert keycode %s - char %s to %s", event.keycode,
                  repr(char), converted_char)
        #         self.text.delete(Tkinter.INSERT + "-1c") # Delete last input char
        self.text.insert(tkinter.INSERT,
                         converted_char)  # Insert converted char
        return "break"
Beispiel #6
0
    def event_key_pressed(self, event):
        """
        So a "invert shift" for user inputs:
        Convert all lowercase letters to uppercase and vice versa.
        """
        char = event.char
        if not char:
            return

        if char in string.ascii_letters:
            char = invert_shift(char)

        self.user_input_queue.put(char)

        # Don't insert the char in text widget, because it will be echoed
        # back from the machine!
        return "break"