You should check "Bomes MIDI Translator". This program is really a big deal! It's not that expensive and does exactly what you want.
I used it some time ago for assigning CMD+S to a MIDI Controller, to save the actual concert to the hard drive of the mac without using the keyboard.