First of all, to all of you, but especially to: Marc and antonio:
PLEASE DO NOT say that something cannot be done just because you don't know how to do it!
Now, regarding the Linux part, I think the way to gou would be with gtk_main_do_event() from libgtk-x11-2.0.
The declaration in Lazarus would be:
procedure gtk_main_do_event(GDKEvent : PGDKEvent); cdecl;external 'gtk-x11-2.0' name 'gtk_main_do_event';
The PGdkEvent type is declared in gdk2 unit;
The documentation mentions the call here:
https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-main-do-eventand someone has a code snipped on using it for sending key event (although not in Lazarus) here:
https://mail.gnome.org/archives/gtk-app-devel-list/2004-July/msg00016.htmlBtw, I just myself am tyring to implement this, and googled out this thread. People who comment on things not being possible without actually knowing, or questioning the asker's reason for wanting to do something in the first place ARE NOT HELPFUL !