def METHOD_NAME(self, event):
    """Handle keyboard keys being pressed."""
    # Ignore presses of the control and shift keys.
    if event.key() not in (QtCore.Qt.Key.Key_Control, QtCore.Qt.Key.Key_Shift):
        self.editor.key = event