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 Media Keys? I already have iTunes disabled on launch so that's no problem. The music player Clementine has them also working when the application is not in focus, how can I have "global" hotkeys?
Many thanks!
Dennis
Did you try:
and others from http://developer.qt.nokia.com/doc/qt-4.8/qt.html ?
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