Just print out some event infomation when keys are pressed.
501378
def main():
    """"""
    while 1:
        events = get_key()
        if events:
            for event in events:
                print(event.ev_type, event.code, event.state)
1069896
def mouse_press_event(self, x, y, button):
        """"""
        if button == 1:
            print("Left mouse button pressed @", x, y)
        if button == 2:
            print("Right mouse button pressed @", x, y)
792688
def mouseGestureHandler(self, info):
        
        print(self.pre, ": mouseGestureHandler: ")
        # *** single click events ***
        if (info.fsingle):
            print(self.pre, ": mouseGestureHandler: single click")
            if (info.button == QtCore.Qt.LeftButton):
                print(self.pre, ": mouseGestureHandler: Left button clicked")
            elif (info.button == QtCore.Qt.RightButton):
                print(self.pre, ": mouseGestureHandler: Right button clicked")
                self.handle_right_single_click(info)
        # *** double click events ***
        elif (info.fdouble):
            if (info.button == QtCore.Qt.LeftButton):
                print(
                    self.pre,
                    ": mouseGestureHandler: Left button double-clicked")
                self.handle_left_double_click(info)
            elif (info.button == QtCore.Qt.RightButton):
                print(
                    self.pre,
                    ": mouseGestureHandler: Right button double-clicked")
1155642
def keyPressEvent(self, event):
        """"""
        ctrl = event.modifiers() & Qt.ControlModifier
        key = event.key()
        handled = False
        if ctrl and self.count() > 0:
            index = self.currentIndex()
            if key == Qt.Key_PageUp:
                if index > 0:
                    self.setCurrentIndex(index - 1)
                else:
                    self.setCurrentIndex(self.count() - 1)
                handled = True
            elif key == Qt.Key_PageDown:
                if index < self.count() - 1:
                    self.setCurrentIndex(index + 1)
                else:
                    self.setCurrentIndex(0)
                handled = True
        if not handled:
            QTabWidget.keyPressEvent(self, event)
182785
def event_key_pressed(self, event):
        
        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"
658704
def keyevent2tuple(event):
    """"""
    return (event.type(), event.key(), event.modifiers(), event.text(),
            event.isAutoRepeat(), event.count())
884308
def keyPressEvent(self, event):
        """"""
        event, text, key, ctrl, shift = restore_keyevent(event)

        if key == Qt.Key_Slash and self.isVisible():
            self.show_find_widget.emit()
1219584
def on_motion(self, event):
        ''
        if self.press is None:
            return

        if event.inaxes != self.ax:
            return
        # print(event.inaxes)

        x0, y0, btn = self.press
        x0.append(event.xdata)
        y0.append(event.ydata)
764276
def _print_result_info(traces, events):
    
    print_v('Returning %i traces:'%len(traces))
    for r in sorted(traces.keys()):
        x = traces[r]
        print_v('  %s (%s): %s -> %s (min: %s, max: %s, len: %i)'%(r, type(x), x[0],x[-1],min(x),max(x),len(x)))
    print_v('Returning %i events:'%len(events))
    for r in sorted(events.keys()):
        x = events[r]
        print_v('  %s: %s -> %s (len: %i)'%(r, x[0] if len(x)>0 else '-',x[-1] if len(x)>0 else '-',len(x)))
18505
def key_event(self, key, action):
        
        if action == self.wnd.keys.ACTION_PRESS:
            if key == self.wnd.keys.SPACE:
                print("Space was pressed")

        if action == self.wnd.keys.ACTION_RELEASE:
            if key == self.wnd.keys.SPACE:
                print("Space was released")
655963
def key_press(keys):
        """"""
        return lambda e: e.key if e.type == pygame.KEYDOWN \
            and e.key in keys else EventConsumerInfo.DONT_CARE
606371
def on_press(callback, suppress=False):
    
    return hook(lambda e: e.event_type == KEY_UP or callback(e), suppress=suppress)
863916
def keyEvent(self, key, down=1):
        """"""
        self.transport.write(pack("!BBxxI", 4, down, key))
969552
def on_release(self, event):
        ''
        if self.press is None:
            return
        # print(self.press)
        x0, y0, btn = self.press
        if btn == 1:
            color = 'r'
        elif btn == 2:
            color = 'b'  # noqa

        # plt.axes(self.ax)
        # plt.plot(x0, y0)
        # button Mapping
        btn = self.button_map[btn]

        self.set_seeds(y0, x0, self.actual_slice, btn)
        # self.fig.canvas.draw()
        # pdb.set_trace();
        self.press = None
        self.update_slice()
543632
def keyPressEvent(self, event):
        """"""
        if event.key() == Qt.Key_Down:
            self.select_row(1)
        elif event.key() == Qt.Key_Up:
            self.select_row(-1)
716856
def press(*keys):
    

    for key in keys:
        win32api.keybd_event(codes[key], 0, 0, 0)
        release(key)
781969
def event_text_key(self, event):
        
        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"