Background info:
I know how to use a keyPressEvent, it works fine when the window is in focus. My keyPressEvent function is as follows:
def keyPressEvent(self, e):
if e.key() == Qt.Key_F7:
self.prevSong()
if e.key() == Qt.Key_F9:
self.nextSong()
The keys are connected to the functions and they do what they are supposed to do
What I am trying to achieve:
Make the same key presses call the same functions when the key is pressed when the window is out of focus or in the background. How can I make this happen on a Mac?