I am using PyQt5 and now that I am overriding the keyPressEvent method, any button click using the same method in my class will only update the screen if the user clicks away. Using the keyboard works fine as intended. Does anyone know what could cause this?
Some code to show:
def keyPressEvent(self, event):
LEFT_KEY = 16777234
RIGHT_KEY = 16777236
if (event.key() == LEFT_KEY):
self.previous()
elif (event.key() == RIGHT_KEY):
self.next()
Button clicks calling self.previous
and self.next
are not working until the user clicks off the program (hiding the window) and clicks on again.