Solved Using two different keys for an Action
-
How can I use two different keys for a QAction ?
from PyQt5.QtWidgets import QAction from PyQt5.QtCore import Qt action = QAction('Any Action', self) action.setShortcut(Qt.Key.Key_Enter or Qt.Key.Key_Return)
Found a solution.
from PyQt5.QtWidgets import QAction from PyQt5.QtCore import Qt shortcuts = [Qt.Key.Key_Enter, Qt.Key.Key_Return] action = QAction('Any Action', self) action.setShortcuts(shortcuts)
-
SGaist