I strongly recommend you check out EventGhost
http://www.eventghost.org/Basically it lets you associate all kinds of inputs (key presses, IR remote signals from all kinds of manufacturer's receivers, 232 signals, they're all possible "events") and converts them into all kinds of actions on the PC.
The actions can be moving the mouse (absolute, relative, start motion at a certain angle, button clicks), key presses and combinations, specific program actions (support for MCE, XBMC, Winamp, Media Monkey and loads more), actions on windows such as absolute move and resize, shutting down the PC and more. All of these actions can be placed into macro.
I've used it to build a 232 "driver" for operating a PC via a 232 control system that includes mouse movement, 99% of the keypresses, and window control. If you have a play with this, start a blank project and add the Serial Port plugin within EventGhost. To get to grips with it, try sending 232 strings to the PC(the one running EventGhost)'s com port using Hyperterminal on a seperate PC or something. With the serial plugin active, you'll see the strings you're sending appear in the log as Events you can drag and drop into your macros full of actions. The next time that same string is received, the macro will be triggerred.