Key pattern for the functional keys?
From my brief research the media keys are passed as events.

As an alternative solution, perhaps you can use a solution similar to the one illustrated here:


Define the keypress you want to perform an action (Using Keyboard Shortcuts in System Preferences or a third-party application like USB Overdrive)
Write an AppleScript to perform the action you need:

tell application "iTunes"
    next track
end tell