I want implement a QDialog, in which a key is pressed for some time (seconds) and is released afterwards.
QDialog
I tried doing this with keyPressEvent>
keyPressEvent>
You need to use isAutoRepeat:
def keyReleaseEvent(self, eventQKeyEvent): key = eventQKeyEvent.key() if key == 54 and not eventQKeyEvent.isAutoRepeat(): print('released')