Filters out key press events for the shortcut section for this edit.
        
        :param      object | <QObject>
                    event  | <QEvent>
177398
def eventFilter( self, object, event ):
        
        if ( object != self.uiShortcutTXT ):
            return False
            
        if ( event.type() == event.KeyPress ):
            seq = QKeySequence(event.key() + int(event.modifiers()))
            self.uiShortcutTXT.setText( seq.toString() )
            return True
            
        elif ( event.type() == event.KeyRelease):
            return True
        
        return False
957445
def eventFilter(self, editor, event):
        """"""
        if event.type() == QtCore.QEvent.FocusIn:
            editor.setContentFocus()
            return True

        return super(ComponentDelegate, self).eventFilter(editor, event)
332112
def key_press_event(self, event):
        
        if event.key() == QtCore.Qt.Key_Return:
            cursor = self.edit.textCursor()
            cursor.movePosition(cursor.EndOfBlock)
            self.edit.setTextCursor(cursor)
        code = _qkey_to_ascii(event)
        if code:
            self.process.writeData(code)
            return False
        return True
593295
def eventFilter(self, object, event):
        
        result = super(XOrbSearchCompleter, self).eventFilter(object, event)
        
        # update the search results
        if event.type() == event.KeyPress:
            # ignore return keys
            if event.key() in (Qt.Key_Return,
                               Qt.Key_Enter):
                return False
            
            # ignore navigation keys
            if event.key() in (Qt.Key_Up,
                               Qt.Key_Down,
                               Qt.Key_Left,
                               Qt.Key_Right,
                               Qt.Key_Shift,
                               Qt.Key_Control,
                               Qt.Key_Alt):
                return result
            
            text = self._pywidget.text()
            if text != self._lastSearch:
                # clear the current completion
                self.model().setStringList([])
                
                # mark for reset
                self._refreshTimer.start()
        
        return result
275477
def hide_shortcuts(self, menu):
        """"""
        for element in getattr(self, menu + '_menu_actions'):
            if element and isinstance(element, QAction):
                if element._shown_shortcut is not None:
                    element.setShortcut(QKeySequence())
893011
def keyPressEvent( self, event ):
        
        # otherwise, eat all other key press events until the 
        # view mode is released
        if ( self.inViewMode() ):
            event.accept()
        
        # when the user presses the space bar, put
        # the scene into view editing mode
        elif ( event.key() == Qt.Key_Space ):
            self.setViewMode(True)
            event.accept()
        
        # cancel the connection if escape is pressed
        elif ( event.key() == Qt.Key_Escape ):
            self.finishConnection(False)
            event.accept()
        
        # otherwise, run the standard key press event
        else:
            super(XNodeScene, self).keyPressEvent(event)
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()
1093513
def eventFilter(self, widget, event):
        """"""
        if ((event.type() == QEvent.MouseButtonPress and
                 not self.geometry().contains(event.globalPos())) or
                (event.type() == QEvent.KeyPress and
                 event.key() == Qt.Key_Escape)):
            # Exits editing
            self.hide()
            self.setFocus(False)
            return True

        # Event is not interessant, raise to parent
        return QLineEdit.eventFilter(self, widget, event)
1258045
def on_key(self, event):
        """"""

        # If paste is running and Esc is pressed then we need to abort

        if event.GetKeyCode() == wx.WXK_ESCAPE and \
           self.pasting or self.grid.actions.saving:
            self.need_abort = True

        event.Skip()
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)
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)
1220232
def eventFilter(self, widget, event):
        """"""

        # ---- Zooming
        if event.type() == QEvent.Wheel:
            modifiers = QApplication.keyboardModifiers()
            if modifiers == Qt.ControlModifier:
                if event.angleDelta().y() > 0:
                    self.zoom_in()
                else:
                    self.zoom_out()
                return True
            else:
                return False

        # ---- Panning
        # Set ClosedHandCursor:
        elif event.type() == QEvent.MouseButtonPress:
            if event.button() == Qt.LeftButton:
                QApplication.setOverrideCursor(Qt.ClosedHandCursor)
                self._ispanning = True
                self.xclick = event.globalX()
                self.yclick = event.globalY()

        # Reset Cursor:
        elif event.type() == QEvent.MouseButtonRelease:
            QApplication.restoreOverrideCursor()
            self._ispanning = False

        # Move  ScrollBar:
        elif event.type() == QEvent.MouseMove:
            if self._ispanning:
                dx = self.xclick - event.globalX()
                self.xclick = event.globalX()

                dy = self.yclick - event.globalY()
                self.yclick = event.globalY()

                scrollBarH = self.horizontalScrollBar()
                scrollBarH.setValue(scrollBarH.value() + dx)

                scrollBarV = self.verticalScrollBar()
                scrollBarV.setValue(scrollBarV.value() + dy)

        return QWidget.eventFilter(self, widget, event)
494486
def keyPressEvent(self, event):
        
        if event.key() == QtCore.Qt.Key_F5 or \
           (event.key() == QtCore.Qt.Key_E and \
            event.modifiers() == QtCore.Qt.ControlModifier):
            code = str(self._edit.toPlainText())
            scope = self.viewWidget().codeScope()
            
            exec code in scope, scope
        else:
            super(XScriptView, self).keyPressEvent(event)
1151237
def eventFilter( self, object, event ):
        
        if ( event.type() == event.KeyPress ):
            if ( event.key() == Qt.Key_Escape ):
                self._completerTree.hide()
                self.completer().popup().hide()
                
                self.cancelEdit()
                
            elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.acceptEdit()
                return True
                
            elif ( event.key() == Qt.Key_Tab ):
                if ( self.completer().popup().isVisible() ):
                    text   = nativestring(self.completer().currentCompletion())
                    super(XNavigationEdit, self).setText(text)
                    return True
                else:
                    self.acceptEdit()
                    return False
            
        elif ( event.type() == event.MouseButtonPress ):
            if ( not self._completerTree.rect().contains(event.pos()) ):
                self._completerTree.hide()
                self.completer().popup().hide()
                
                self.cancelEdit()
        
        return False
300934
def eventFilter( self, object, event ):
        
        if event.type() == event.Resize:
            self.resize(event.size())
            
        elif event.type() == event.Move:
            self.move(event.pos())
        
        elif event.type() == event.Close:
            self.setParent(None)
            self.deleteLater()
        
        return False
1028925
def keyPressEvent(self, event):
        """"""
        event, text, key, ctrl, shift = restore_keyevent(event)
        cursor_position = self.get_position('cursor')

        if cursor_position < self.header_end_pos:
            self.restrict_cursor_position(self.header_end_pos, 'eof')
        elif key == Qt.Key_Delete:
            if self.has_selected_text():
                self.remove_text()
            else:
                self.stdkey_clear()
        elif key == Qt.Key_Backspace:
            if self.has_selected_text():
                self.remove_text()
            elif self.header_end_pos == cursor_position:
                return
            else:
                self.stdkey_backspace()
        elif key == Qt.Key_X and ctrl:
            self.cut()
        else:
            CodeEditor.keyPressEvent(self, event)
1281941
def keyPressEvent( self, event ):
        
        if ( self.scrollWidget().isHidden() ):
            if ( event.key() == Qt.Key_Escape ):
                self.cancelEdit()
                return
                
            elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.acceptEdit()
                return
            
        elif ( event.key() == Qt.Key_A and 
               event.modifiers() == Qt.ControlModifier ):
            self.startEdit()
        
        super(XNavigationEdit, self).keyPressEvent(event)