PySide2 | Finding out which QKeySequence was pressed
问题 I'm using PySide2 and I want to have multiple shortcuts that carry out the same function but also would depend on which key was pressed. I tried to link the functions as such inside a QMainWindow: QtWidgets.QShortcut(QtGui.QKeySequence("1"),self).activated.connect(self.test_func) QtWidgets.QShortcut(QtGui.QKeySequence("2"),self).activated.connect(self.test_func) Such that they both execute this function. def test_func(self, signal): print(signal) Hoping that print("1") happens when the key "1