QKeyPress event in PyQt
I am having issues with my software. In my piano software if I keep pressing a key on the keyboard then it is making multiple repeated same tones of that particular key. But actually I need a single tone until the release of that particular key. I'm providing a part of my code that detects the keyPress event and calls the corresponding method. So what should be the changes that I've to do with my code?? def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent and event.key() == QtCore.Qt.Key_A : self.Playnote('/home/hemanth/hemanth/Piano/C.mp3') self.ui.pushButton.animateClick(100) if