Script for hot keys in remote desktop. Possible?

Is it possible to make a script that will listen for input from the keyboard in any application, that will then perform a remote desktop action?

For example;

I am using iCal (or any other application) I can then press F6 to perform an action in remote desktop without having to switch to the remote desktop application.

The action in question will send a Unix command to all the computers on the network to mute them all. Using [ osascript -e ’ } command to run applescripts from the terminal feature in remote desktop.

I have no idea where to start.

Cheers