I’ve just added to GitHub a little virtual keystroke interface for Windows and OS X – on the former it wraps the SendInput API, on the latter the CGEvent functions:
Virtually typing some text into the active window is a one-liner:
Alternatively, you can build up a sequence of keystrokes to perform by working with an explicit IVirtualKeySequence instance:
Sequence := TVirtualKeySequence.Create;
Sequence.Add(vkA, [ssCommand], [keDown, keUp]);
Sequence.Add(vkA, [ssCtrl], [keDown, keUp]);
For more on the available methods, check out the readme at the above link. The repository also includes a simple demo in FMX and VCL forms (code is essentially the same).