diff --git a/template/qtgui/mainwindow.py b/template/qtgui/mainwindow.py index 8e6f4a3..ec3a3c9 100644 --- a/template/qtgui/mainwindow.py +++ b/template/qtgui/mainwindow.py @@ -377,7 +377,7 @@ class MainWindow(QtWidgets.QMainWindow): This event filter somehow does not differentiate between numpad on or numpad off. There maybe is another qt check for that. """ - if (not self.menu.ui.menubar.activeAction()) and event.type() == 51 and type(event) is QtGui.QKeyEvent and event.modifiers() == QtCore.Qt.KeypadModifier and event.text() and event.text() in "0123456789": + if (not self.menu.ui.menubar.activeAction()) and event.type() == QtCore.QEvent.ShortcutOverride and type(event) is QtGui.QKeyEvent and event.modifiers() == QtCore.Qt.KeypadModifier and event.text() and event.text() in "0123456789": action = self.menu.hoverShortcutDict[event.text()] if action: action.trigger()