I have a code example in the archives that clicks the mouse using Windows' SendInput function. You could modify this to insert keyboard events. Do a search for MSDN + Sendinput on google.
Using API to press a key
BlitzMax Forums/BlitzMax Programming/Using API to press a keyThe forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.