Does it have to be serial? An easy option would be to wire it up to a keyboard controller (PS2 or USB), and you won't need a program at all.
If it has to be serial, and you can't find any existing software to do what you want, PM me and I can write up some code to do what you want. I might require a bit of bribing though