Called when a key is pressed.
2001
@Override
    public void keyPressed(KeyEvent e) {
        switch (e.getKeyCode()) {
        case KeyEvent.VK_BACK_SPACE:
        case KeyEvent.VK_ENTER:
        case KeyEvent.VK_DELETE:
        case KeyEvent.VK_TAB:
            e.consume();
            break;
        }
    }
825427
def press(self):
    """"""
    self._lutron.send(Lutron.OP_EXECUTE, Keypad._CMD_TYPE, self._keypad.id,
                      self.component_number, Button._ACTION_PRESS)
476346
def on_feed_key(self, key_press):
        """"""
        if key_press.key in {Keys.Escape, Keys.ControlC}:
            echo(carriage_return=True)
            raise Abort()
        if key_press.key == Keys.Backspace:
            if self.current_command_pos > 0:
                self.current_command_pos -= 1
            return key_press
        ret = None
        if key_press.key != Keys.CPRResponse:
            if self.current_command_pos < len(self.current_command):
                current_key = self.current_command_key
                ret = KeyPress(current_key)
                increment = min(
                    [self.speed, len(self.current_command) - self.current_command_pos]
                )
                self.current_command_pos += increment
            else:
                # Command is finished, wait for Enter
                if key_press.key != Keys.Enter:
                    return None
                self.current_command_index += 1
                self.current_command_pos = 0
                ret = key_press
        return ret
716856
def press(*keys):
    

    for key in keys:
        win32api.keybd_event(codes[key], 0, 0, 0)
        release(key)
259125
def handle_keypress(self):
        """"""
        if self.numpress == 2:
            self.sig_double_tab_pressed.emit(True)
        self.numpress = 0
1064457
def key_press_event(self, obj, event):
        
        key = self.iren.GetKeySym()
        log.debug('Key %s pressed' % key)
        if key == 'q':
            self.q_pressed = True
            # Grab screenshot right before renderer closes
            self.last_image = self.screenshot(True, return_img=True)
        elif key == 'b':
            self.observer = self.iren.AddObserver('LeftButtonPressEvent',
                                                  self.left_button_down)
        elif key == 'v':
            self.isometric_view_interactive()
371797
def keypress(self, event):
        """"""
        try:
            self.choice.set(self.shortcuts[event.keysym])
        except KeyError:
            # key not found (probably a bug, since we intend to catch
            # only events from shortcut keys, but ignore it anyway)
            pass
738204
def keyPress(self, key):
        
        log.debug('keyPress %s', key)
        self.keyDown(key)
        self.keyUp(key)

        return self
1154386
public void keyDown(String key, List<ModifierPressed> modifiers) {
    systemInputManager.keyDown(key, modifiers);
  }
1147540
public void pressKey(final String key) {
        if (key == null) return;

        runWithRetries(() -> {
            elementImpl.locateElement().sendKeys(key);
        });
    }
655963
def key_press(keys):
        """"""
        return lambda e: e.key if e.type == pygame.KEYDOWN \
            and e.key in keys else EventConsumerInfo.DONT_CARE
884452
def on_key_down(self, event):
        ''''''
        state = self.state

        # send all key events to the parent
        if self.mouse_pos:
            latlon = self.coordinates(self.mouse_pos.x, self.mouse_pos.y)
            selected = self.selected_objects(self.mouse_pos)
            state.event_queue.put(SlipKeyEvent(latlon, event, selected))

        c = event.GetUniChar()
        if c == ord('+') or (c == ord('=') and event.ShiftDown()):
            self.change_zoom(1.0/1.2)
            event.Skip()
        elif c == ord('-'):
            self.change_zoom(1.2)
            event.Skip()
        elif c == ord('G'):
            self.enter_position()
            event.Skip()
        elif c == ord('C'):
            self.clear_thumbnails()
            event.Skip()
210513
public static void keyPressWithCtrl(int key) {
		robot.keyPress(KeyEvent.VK_CONTROL);
		robot.keyPress(key);
		robot.keyRelease(key);
		robot.keyRelease(KeyEvent.VK_CONTROL);
		delay();
	}
676943
def on_setButton_pressed(self):
        
        self.keyLabel.setText("Press a key or combination...")  # TODO: i18n
        logger.debug("User starts to record a key combination.")
        self.grabber = iomediator.KeyGrabber(self)
        self.grabber.start()
276782
public static void keyPressWithAlt(int key) {
		robot.keyPress(KeyEvent.VK_ALT);
		robot.keyPress(key);
		robot.keyRelease(key);
		robot.keyRelease(KeyEvent.VK_ALT);
		delay();
	}
1085007
public void pressKey(final Keys keys) {
        if (keys == null) return;

        runWithRetries(() -> {
            elementImpl.locateElement().sendKeys(keys);
        });
    }
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")