How is it possible to have global hotkeys in OSX?

By "global" I mean that kind of shortcuts that I am using in Windows and that are set within and for an application but that can be used when that application is hidden or minimized (not on top). (e.g. the ones discussed here.)

I see that in this article here on "OS X Mavericks: Use global keyboard shortcuts" that shortcuts are called "global" but in a different sense - it seems to me - because they are only available if the given application is already active (focused upon, on top, like for example a text editor in which I can write) but not if it is not in this position (for example: if the text editor is open and ready for writing, then, the shortcuts available for an audio player will not be accessible).

So, I am not referring to the media keys on the keyboard, but to ones that I can set in an application and then can use when other application is active and actively used.

When adding some shortcuts for vlc under Keyboard settings, they are not global in this sense.

enter image description here


Solution 1:

You can assign a shortcut to a script like this:

tell application "System Events" to tell process "VLC"
    click menu item "Step Forward" of menu 1 of menu bar item "Playback" of menu bar 1
end tell

For example save the script in ~/Library/Scripts/ in AppleScript Editor and then use FastScripts to give it a shortcut. Or if you have bought the Powerpack for Alfred, you can create a workflow with a Hotkey trigger connected to a Run Script action.