Function will handle followind keyPress scenarios when Shift key is not pressed.
971322
function handleHardNewlineEvent(editorState: EditorState): EditorState {
  const selection = editorState.getSelection();
  if (selection.isCollapsed()) {
    const contentState = editorState.getCurrentContent();
    const blockKey = selection.getStartKey();
    const block = contentState.getBlockForKey(blockKey);
    if (
      !isListBlock(block) &&
      block.getType() !== 'unstyled' &&
      block.getLength() === selection.getStartOffset()
    ) {
      return insertNewUnstyledBlock(editorState);
    } else if (isListBlock(block) && block.getLength() === 0) {
      const depth = block.getDepth();
      if (depth === 0) {
        return removeSelectedBlocksStyle(editorState);
      }
      if (depth > 0) {
        return changeListDepth(editorState, -1, depth);
      }
    }
  }
  return undefined;
}
1113466
def keyPressEvent(self, event):
        ""
        key = event.key()
        if key == Qt.Key_Escape:
            self.app.quit()
1294180
def _bind_key(self, key, func):
        """
        if not callable(func):
            print u"Trying to bind non method to keystroke:%s,%s"%(key,func)
            raise ReadlineError(u"Trying to bind non method to keystroke:%s,%s,%s,%s"%(key,func,type(func),type(self._bind_key)))
        keyinfo = make_KeyPress_from_keydescr(key.lower()).tuple()
        log(u">>>%s -> %s<<<"%(keyinfo,func.__name__))
        self.key_dispatch[keyinfo] = func
380140
def focusInEvent(self, event):
        
        if not self.signalsBlocked():
            self.focusChanged.emit(True)
            self.focusEntered.emit()
        
        return super(XTextEdit, self).focusInEvent(event)
43423
def keyPressEvent(self, event):
        """"""
        ctrl = event.modifiers() & Qt.ControlModifier
        shift = event.modifiers() & Qt.ShiftModifier
        if event.key() in (Qt.Key_Enter, Qt.Key_Return):
            self.find.emit()
        elif event.key() == Qt.Key_F and ctrl and shift:
            # Toggle find widgets
            self.parent().toggle_visibility.emit(not self.isVisible())
        else:
            QWidget.keyPressEvent(self, event)
372106
function handleKeydown(keyCodes, e, callback) {
    const keyCode = e.charCode || e.keyCode;
    if (keyCodes.indexOf(keyCode) !== -1) {
        callback();
    }
}
1113655
function(e) {
        var E = YAHOO.util.Event,
            KEYS = YAHOO.util.KeyListener.KEY;

        if (E.getCharCode(e) == KEYS.TAB && !e.shiftKey) {
            try {
                E.preventDefault(e);
                this.firstCtrl.focus();
            } catch (err) {
                // Ignore - mainly for focus edge cases
            }
        }
    }
731893
def on_key_press(self, event):
        """"""
        # Zooming with the keyboard.
        key = event.key
        if event.modifiers:
            return

        # Pan.
        if self.enable_keyboard_pan and key in self._arrows:
            self._pan_keyboard(key)

        # Zoom.
        if key in self._pm:
            self._zoom_keyboard(key)

        # Reset with 'R'.
        if key == 'R':
            self.reset()
1083020
def press_key(self, character=''):
        
        try:
            shifted = self.is_char_shifted(character)
        except AttributeError:
            win32api.keybd_event(character, 0, 0, 0)
        else:
            if shifted:
                win32api.keybd_event(self.shift_key, 0, 0, 0)
            char_vk = win32api.VkKeyScan(character)
            win32api.keybd_event(char_vk, 0, 0, 0)
1275479
function handleNotKeydown(keyCodes, e, callback) {
    const keyCode = e.charCode || e.keyCode;
    if (keyCodes.indexOf(keyCode) === -1) {
        callback();
    }
}
1034632
def keyPressEvent(self, ev):
        """"""
        if ev.key() in (Qt.Key_Enter, Qt.Key_Return):
            self._startOrStopEditing()
        elif ev.key() == Qt.Key_Escape:
            self._cancelEditing()
        else:
            Kittens.widgets.ClickableTreeWidget.keyPressEvent(self, ev)
1135661
def handle_keypress(screen):
    
    global selected_pid
    try:
        key = screen.getkey().upper()
    except:
        return
    if key in ("KEY_DOWN", "J"):
        move_selection()
    elif key in ("KEY_UP", "K"):
        move_selection(reverse=True)
    elif key in ("A", "+"):
        send_signal("TTIN")
        if selected_pid in gunicorns:
            gunicorns[selected_pid]["workers"] = 0
    elif key in ("W", "-"):
        if selected_pid in gunicorns:
            if gunicorns[selected_pid]["workers"] != 1:
                send_signal("TTOU")
                gunicorns[selected_pid]["workers"] = 0
    elif key in ("R",):
        if selected_pid in gunicorns:
            send_signal("HUP")
            del gunicorns[selected_pid]
            selected_pid = None
    elif key in ("T",):
        for pid in gunicorns.copy().iterkeys():
            selected_pid = pid
            send_signal("HUP")
            del gunicorns[selected_pid]
            selected_pid = None
    elif key in ("M", "-"):
        if selected_pid in gunicorns:
            send_signal("QUIT")
            del gunicorns[selected_pid]
            selected_pid = None
    elif key in ("Q",):
        raise KeyboardInterrupt
917172
function(pref, down, move, up, cancel) {
				_dragStartEvent = pref + down;
				_dragMoveEvent = pref + move;
				_dragEndEvent = pref + up;
				if(cancel) {
					_dragCancelEvent = pref + cancel;
				} else {
					_dragCancelEvent = '';
				}
			}
1371634
def keyPressEvent( self, event ):
        
        if ( event.key() == Qt.Key_C and \
             event.modifiers() == Qt.ControlModifier ):
            self.copy()
            event.accept()
            return
            
        elif ( event.key() == Qt.Key_V and \
             event.modifiers() == Qt.ControlModifier ):
            self.paste()
            event.accept()
            return
        
        elif ( event.key() == Qt.Key_Delete ):
            indexes = map(self.row, self.selectedItems())
            for index in reversed(sorted(indexes)):
                self.takeItem(index)
            
            event.accept()
            return
        
        elif event.key() == Qt.Key_Backspace:
            if self.count() > 1:
                self.takeItem(self.count() - 2)
                self.setFocus()
        
        super(XMultiTagEdit, self).keyPressEvent(event)
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)
409366
@UiHandler("m_searchInput")
    protected void onSearchInputKeyPress(KeyPressEvent event) {

        if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                public void execute() {

                    m_tabHandler.selectResultTab();
                }
            });
        } else {

            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                /**
                 * @see com.google.gwt.user.client.Command#execute()
                 */
                public void execute() {

                    ValueChangeEvent.fire(m_searchInput, m_searchInput.getText());
                }
            });
        }
    }
40607
protected void onTimeKeyPressed(KeyUpEvent event) {

        switch (event.getNativeEvent().getKeyCode()) {
            case KeyCodes.KEY_CTRL:
            case KeyCodes.KEY_SHIFT:
            case KeyCodes.KEY_ALT:
            case KeyCodes.KEY_LEFT:
            case KeyCodes.KEY_RIGHT:
                break;
            case KeyCodes.KEY_ENTER:
                updateFromPicker();
                hidePopup();
                break;
            default:
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                    public void execute() {

                        executeTimeAction();
                        fireChange(getValue(), false);
                    }
                });
                break;
        }
    }