I want to make a small Qt application which will show an onscreen keyboard with 2-3 keys only. When i press a button on the on-screen keyboard using mouse, the corresponding key event should be sent to the active window. Active window in this case should not be the Qt application but the last active window on which the user clicked.

An example of the above description can be found by running the Gnome on-screen keyboard i.e. GoK (http://www.gok.ca/).

So, if the user has a text editor open in the background, he should be able to send keystrokes to the text editor by clicking on the onscreen keyboard application made in Qt. The onscreen keyboard should be visible at all times and should stay on top of other applications.

Now, i don't know how to send events to the other application from Qt application i.e. how to make Qt application as an overlay application so that it stays in view all the time (similar to GoK) and sends events to other applications.

I searched on the net and found that GoK uses AT SPI for sending key events but it might not be useful in my case as i don't want dependency on any window manager and AT SPI seems to be dependent on GNOME.

Also, i think i can send events to other application using XSendEvent API of xwindows but i don't want X11 dependency either as my onscreen keyboard will run on an embedded device without X11.

I found that i might be able to use DBus as an alternative to AT SPI but i don't know for sure.

Please help me if anybody has an idea about it. I know how to send events to the linux applications by writing to the device file (/dev/input/event*) but i have no idea how to send events to other application without using X11 APIs.