Check out OSCulator if you're on a Mac.
<a href="http://www.osculator.net/" rel="nofollow">http://www.osculator.net/</a>
You can route MIDI, plus a number of other types of physical controllers like a Wii Remote to keyboard commands, mouse movements, AppleScripts, and more.