Press and release a given character key n times.
517685
def tap_key(self, character='', n=1, interval=0):
        """"""
        for i in range(n):
            self.press_key(character)
            self.release_key(character)
            time.sleep(interval)
208622
function( key, character, shiftKey, altKey, ctrlKey, metaKey )
        {
            // submit form on enter-key
            if( interceptenter && key == 13 && ! shiftKey && ! altKey && ! ctrlKey && ! metaKey )
            {
                commands.sync();
                if( interceptenter() )
                {
                    commands.closePopup();
                    return false; // swallow enter
                }
            }
            // Exec hotkey (onkeydown because e.g. CTRL+B would oben the bookmarks)
            if( character && !shiftKey && !altKey && ctrlKey && !metaKey )
            {
                var hotkey = character.toLowerCase();
                if( hotkeys[hotkey] )
                {
                    hotkeys[hotkey]();
                    return false; // prevent default
                }
            }
            // Handle suggester
            if( suggester )
                return suggester_keydown( key, character, shiftKey, altKey, ctrlKey, metaKey );
        }
975204
def onKeyReleaseInCanvas(self, event):
        ''''''
        char_map = { 'w':'move 0', 'a':'strafe 0', 's':'move 0', 'd':'strafe 0', ' ':'jump 0' }
        keysym_map = { 'Left':'turn 0', 'Right':'turn 0', 'Up':'pitch 0', 'Down':'pitch 0', 'Shift_L':'crouch 0', 'Shift_R':'crouch 0', 
                       '1':'hotbar.1 0', '2':'hotbar.2 0', '3':'hotbar.3 0', '4':'hotbar.4 0', '5':'hotbar.5 0',
                       '6':'hotbar.6 0', '7':'hotbar.7 0', '8':'hotbar.8 0', '9':'hotbar.9 0' }
        if event.char.lower() in char_map:
            self.agent_host.sendCommand( char_map[ event.char.lower() ] )
        elif event.keysym in keysym_map:
            self.agent_host.sendCommand( keysym_map[ event.keysym ] )
1249937
def _keyUp(key):
    

    """
    Release a given character key. Also works with character keycodes as
    integers, but not keysyms.
    """
    if key not in keyboardMapping or keyboardMapping[key] is None:
        return

    if type(key) == int:
        keycode = key
    else:
        keycode = keyboardMapping[key]

    fake_input(_display, X.KeyRelease, keycode)
    _display.sync()
1085007
public void pressKey(final Keys keys) {
        if (keys == null) return;

        runWithRetries(() -> {
            elementImpl.locateElement().sendKeys(keys);
        });
    }
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()
226088
def onKeyInCommandEntry(self, event):
        ''''''
        if event.char == '\r':
            self.onSendCommand()
            self.canvas.focus_set()
279763
public void keyPress(String key, List<ModifierPressed> modifiers) {
    systemInputManager.keyPress(key, modifiers);
  }
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
522885
def pause(msg="Press Enter to Continue..."):
    """"""
    print('\n' + Fore.YELLOW + msg + Fore.RESET, end='')
    input()
1228224
def keyPressEvent(self, event):
        """"""
        if event.key() == Qt.Key_Alt:
            self._alt_key_is_down = True
            self.update()
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")
366547
def _on_press(self, event):
        """"""
        if tk.DISABLED in self.state():
            return

        region = self.identify_region(event.x, event.y)

        if self._drag_cols and region == 'heading':
            self._start_drag_col(event)
        elif self._drag_rows and region == 'cell':
            self._start_drag_row(event)
1062713
def lock(key, text):
    """"""
    return hmac.new(key.encode('utf-8'), text.encode('utf-8')).hexdigest()
57966
function (key) {
        let _that = this[PRIVATE];

        key = KEYMAP[key.toUpperCase()];
        if (key < _that.pressed.length && key != null) {
            _that.pressed[key] = true;
        }
    }
586514
def press_enter(multiple=False, silent=False):
    """"""

    def f():
        try:
            while True:
                if silent:
                    yield input()
                else:
                    sys.stderr.write("<press enter> ")
                    sys.stderr.flush()
                    yield input()
                if not multiple:
                    break
        except (EOFError, KeyboardInterrupt):
            # User Ctrl+D or Ctrl+C'd
            if not silent:
                # Prevents the user's terminal getting clobbered
                sys.stderr.write("\n")
                sys.stderr.flush()
            return

    return f
200071
def keypress(self, viewer, event, data_x, data_y):
        """"""
        keyname = event.key
        chname = self.get_channel_name(viewer)
        self.logger.debug("key press (%s) in channel %s" % (
            keyname, chname))
        # TODO: keyboard accelerators to raise tabs need to be integrated into
        #   the desktop object
        if keyname == 'Z':
            self.ds.raise_tab('Zoom')
        ## elif keyname == 'T':
        ##     self.ds.raise_tab('Thumbs')
        elif keyname == 'I':
            self.ds.raise_tab('Info')
        elif keyname == 'H':
            self.ds.raise_tab('Header')
        elif keyname == 'C':
            self.ds.raise_tab('Contents')
        elif keyname == 'D':
            self.ds.raise_tab('Dialogs')
        elif keyname == 'F':
            self.build_fullscreen()
        elif keyname == 'f':
            self.toggle_fullscreen()
        elif keyname == 'm':
            self.maximize()
        elif keyname == '<':
            self.collapse_pane('left')
        elif keyname == '>':
            self.collapse_pane('right')
        elif keyname == 'n':
            self.next_channel()
        elif keyname == 'J':
            self.cycle_workspace_type()
        elif keyname == 'k':
            self.add_channel_auto()
        elif keyname == 'K':
            self.remove_channel_auto()
        elif keyname == 'f1':
            self.show_channel_names()
        ## elif keyname == 'escape':
        ##     self.reset_viewer()
        elif keyname in ('up',):
            self.prev_img()
        elif keyname in ('down',):
            self.next_img()
        elif keyname in ('left',):
            self.prev_channel()
        elif keyname in ('right',):
            self.next_channel()
        return True