You are not logged in.

#1 2010-05-28 16:16:31

Blizz4rd
Member
Registered: 2007-05-21
Posts: 10

Controlling an application running in a different workspace

Hello everyone,

Is it possible to capture an application window (screenshot) running in a different workspace and send keyboard/mouse events to it without leaving the current workspace ?

Any help to get me started will be very appreciated

Thanks in advance

Blizz4rd

Offline

#2 2010-05-28 17:14:52

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: Controlling an application running in a different workspace

I don't know about screenshots, but for sending events you might try xdotool. It can either just simulate input, or it can send events to a specific window if the window allows it. See "Sendevent notes" in its manual page on the limitations that apply.

Offline

#3 2010-05-30 14:52:23

Blizz4rd
Member
Registered: 2007-05-21
Posts: 10

Re: Controlling an application running in a different workspace

Well I was hoping to resolve this by programming, ie: java or C but thanks anyway, at least I know it's kinda doable smile

Offline

#4 2010-05-31 17:06:04

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: Controlling an application running in a different workspace

Sorry, I sometimes miss the forum category... smile

man XSendEvent and XTestFakeKeyEvent for sending events. With XSendEvent, you can compose synthetic events and send them to specific windows. The downside is that windows may refuse those events. Some apps allow them by default, some don't allow them at all, some let the user decide. With XTest you can simultate events, i.e. send a key as if the user had hit it, which means it will end up in any window currently focused. Also, if you send a "c" while the user holds down ctrl, it will result in Ctrl+c... So both methods have some limitations.

I still don't know about screenshots, but afaik x11 has sth called the BackingStore in which visual contents of windows are cached that are not currently visible.

Offline

Board footer

Powered by FluxBB