I\'m following Mark Summerfield\'s Rapid GUI Programming with Python and Qt which is using PyQt4. I\'d prefer to be working with PyQt5, but I have both on my ma
Another answer is to add keyPressEvent() method to capture keyboards events.
It will call your updateUi() method when the correct key is pressed.
def keyPressEvent(self, event):
key = event.key()
if key == Qt.Key_Enter:
#For Enter of keyboard number
print("key Enter press")
self.updateUi()
if key == Qt.Key_Return:
#For Enter of keyboard
print("key Enter press")
self.updateUi()