Ok, since I don't feel like reading up on the other thread, you want to
1) Have the IDE execute something based on events in the IDE
2) Have something external inject a key-stroke to the IDE (or anything that then trigger something that the IDE can do).
The key mapping is handled between the IDE and SynEdit.
Though if the editor is not focused, then Keystrokes may be found as they are assigned to menu and toolbutton. That bit of code I haven't looked at in a while... Search for TIdeCommand and expect a fun trail of pieces to follow)
SynEdit.[utf8]KeyDown can look up the command from the KeyStrokes. It calls SynEdit.CommandProcessor
SynEdit then triggers events OnProcessUserCommand or OnProcessCommand (depending on the command) => those are handled in SourceEditor, and forwarded to the IDE (main.pp IIRC - it should join the TIdeCommand trail at this point).
The IDE has on option to only run one instance, and if you double click a file, then the OS starts a new IDE, but that can find the running IDE, and hand over.
There is (probably) a pid file, or some shared mem lock file or similar....
If you track that down, you can possible use that for other stuff than just opening files... But, that also falls under: I haven't looked at in ages, and even then never in detail.