I should know how to do this, but I haven't written any "C" code in years!
We have these proprietary keyboards here that have either failed or are in the process of failing. We have tried to get them repaired or replaced, to no avail. They have special graphics keys on them. They are self-powered and connect directly to a proprietary Graphics Generating "Box" that drives an HMI development environment.
We have the mappings for the keys. All we need is a simple "C" program to run on a Windows 7 Desktop that will read keyboard input (from a Logic Controls KB-1800 programmable keyboard), and then send the appropriate 2-byte sequence out the Serial Port (DB9 Connector) to the Graphics Box (DB25 connector).
I think I need to use getc(stdin) (???) ... but how is the data written out the Serial Port? Is there a special function for that (which would also set up the Comms parameters (like 9600, 8 bits, 1 stop bit, No parity).
First Key to make work: LOGIN. When this key is pressed, the HEX sequence "10 0D" is sent to the Graphics Box from the (failing) proprietary keyboard