I am writing a small console program. It opens, waits for the user, accepts a small chunk of data from a barcode reader (system sees it as a usb keyboard), does some processing on that data, then puts the resulting information in the clipboard buffer so that the user can paste it into another program. Works perfectly as evidenced by pasting the data into a text document.
Unfortunately, the program the user needs the processed information in does not accept tab characters to move between fields on the screen when using the paste function. Works perfectly fine when you're at the keyboard and press the tab key, but not when pasting. The client machine is under windoze 10.
The only solution I can think of is to somehow either close the console window for the program with it still running or switch to the previously active program and then simulate the keys being pressed on a their keyboard so the input will go into the third party program. Don't know if the former is possible with a console application. As far as the latter, I simply do not know how to go about simulating key presses in Lazarus. If I'm able to get it working this way, I won't have to mess with the user's clipboard buffer either.
Anyone have any ideas or hints? (Or see another method of accomplishing this?)