Could you email me the code sample? I would like to take a look at it.
One way i can think of is to have a text entry area on your keyboard emulator, and after you enter all necessary text, Then set the new focus and send it all.
I did a little experimenting with the code myself that i posted. I have attached a module with a function that nearly replaces the sendkeys function. I am sure by looking at the notes, it will become apparent what needs to be done to add more functionality if what you want is missing. Basically, i just haven't added all of the constants for cursoring around, etc.