You are not logged in.
Hi!
So... is this possible / how? I'd like to send keyboard events to a window in the background - maybe even in regular intervals. While I'm dong something else, in another window (or nothing).
Thx!
Last edited by whoops (2011-07-21 11:05:44)
Offline
zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)
Offline
Thanks!
But is there a way to send the input to a specific window / application (that might be in the background, on another desktop or something)?
(Without running the application in its own xserver?)
Last edited by whoops (2011-07-21 09:24:13)
Offline
Have a look at xdotool. Use it to get the window id first, say for gimp
win=$(xdotool search --onlyvisible --class gimp | head -1)
then to send it a key combo
xdotool key --clearmodifiers --window $win Ctrl+q
or to switch to it
xdotool windowactivate $win
Offline
Thanks, xdotools seems to do the job a lot better!
Keyboard works fine. I didn't manage to send mouse events yet, but that compiz might be at fault there - going to try again later.
Offline
Actually I'm thinking, maybe there is a totally another (better?) way to do what you want. I usually find that automatizing tasks in linux differs very much from the windows experinece, most of the times scripting is the most powerful and easy way of doing things. So if you describe to us what you want to accomplish, maybe some experienced linux gurus would give you some advices that sets you off course from sending keys and mouse events. I used to do that in windows with autohotkey, but now in linux there was no need for that so far ever, except for using system wide abbreviations with autokey.
zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)
Offline
Nope, not automatizing anything, just keeping an application out of idle mode, but thx!
Offline