osxmmkeys is a simple Python library for handling media keys on OS X. Key presses can be observed with no side effects, or have their default behaviours overridden entirely.
To install osxmmkeys with pip, use:
Simple example:
Threaded example:
Supported key names:
play_pause
next_track
prev_track
mute
volume_down
volume_up
backlight_down
backlight_up
kb_backlight_down
kb_backlight_up