Skip to content Skip to sidebar Skip to footer

Pyqt Osx Media Keys

I'm creating a music player app with PyQT and I've defined a couple them as toolbar buttons. I can easily set the shortcut with setShortcut, but how can I set them to the OS X Medi

Solution 1:

Did you try:

QKeySequence(Qt.Key_MediaPlay)

and others from http://developer.qt.nokia.com/doc/qt-4.8/qt.html ?

Solution 2:

You only get global hot keys when you use the OSX native methods which seemingly change every minor release. An older example of this (i.e. doesn't work in Lion AFAIK) is available in libQxt

https://bitbucket.org/libqxt/libqxt/src/956e213e4f2d/src/gui/qxtglobalshortcut_mac.cpp

Post a Comment for "Pyqt Osx Media Keys"