[Gllug] share keyboard input between two applications

Walter Stanish walter.stanish at saffrondigital.com
Mon Oct 12 08:30:43 UTC 2009


>>>   can anyone tell me if it is possible to share keyboard input events
>>>   between two or more applications simultaneously? and if so, how?
>>>   I want to try playing music while simultaneously typing text (don't
>>>   ask why).

>> You could try using an X event simulator like xdotool:
>>  http://pratyeka.org/fake-x-input/ 

> That would be great if it let me specify the window to send the keyboard
> event to, but I have to make it the active window first.

I don't think you have to make it the active window - you just need the
Window ID which is most easily obtained that way.  Sorry about the URL
Above being a bit sketchy, it was more personal notes than a comprehensive
description of xdotool (which is beyond my knowledge), but I believe
it should be possible to achieve what you want using xdotool.

You could even run a virtual framebuffer instance of X11, in which you
launch your target application, establish it's window ID, then send
events.
 
I'm sure there are more elegant solutions, but this one is workable
if extremely inefficient/hacky :)

- Walter
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list