On Ubuntu desktop, can I use xdotool to mouse click (e.g. click a link) and press some keys (e.g. ctrl+s) on a window (e.g. Firefox's window) that is not in the front, so that I can work on another different window which may need to lie on top of the other windows, while at the same time, let xdotool to work on a hidden window? Thanks.
You can send keystrokes directly to specific window, by executing:
xdotool type --window Firefox hello
Xdotool will generate key events and send them directly to window Firefox. But sending keystrokes to a specific window uses a different API than simply typing to the active window, and many applications just ignore them. (source:
man xdotool, link)
Also it says that Firefox 3 seemed to ignore all input when it does not have focus, not sure about recent versions.