Provide key press to another program

Can anyone help/suggest a way to fool a program into believing a key has
been pressed under NT V4.0.  The program concerned is a Terminal Emulator
and the reason for wanting to cause the key press is to keep the connection
open/alive.

Any suggestions or sources of information would be gretly appreciated.

Thanks
Rob.