Code for handling the media keys on a Mac keyboard in a way that allows them to be shared between applications but keeps the Apple applications from accidentally being triggered.

SPMediaKeyTap web site

SPMediaKeyTap source code