def METHOD_NAME(self, widget, event):
    key_pressed = event.type() == QEvent.KeyPress
    enter_pressed = key_pressed and (event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return)
    focus_changed = event.type() == QEvent.FocusOut
    if enter_pressed or focus_changed:
        self.axistagsUpdated.emit()
    return False