Comments (3)
Then I tried opening another terminal window, and running:
a[uname@computer ~]$ xdotool search --class gnome-terminal key --window %@ a
[uname@computer ~]$
and nothing happened in either terminal.
This can sometimes happen and most of the time it is because the program is intentionally ignoring the keypress events sent by xdotool. GTK apps appear to do this by default, for example, such as gnome-terminal and Firefox. You can read more about this in the xdotool manpage under SENDEVENT NOTES
if you want to know more about the phenomenon.
The best workaround I can offer is to send keyboard events only to the currently-active window. If you need to send keyboard events to multiple windows using this technique, you'll need to have xdotool search
provide you a list of windows and then activate each window (bringing it forward and giving it focus for your keyboard/mouse events) and then send keystrokes.
For example:
xdotool search --class gnome-terminal key | xargs -I@ -n1 xdotool windowactivate --sync @ type hello
This uses sends the list of window identifiers to a tool called xargs
which will run xdotool for each window identifier printed by xdotool and uses '@' as a placeholder for the window identifier for each xdotool run.
The commands it runs uses:
windowactivate --sync
-- this activates one window and waits for it to be the activated windowtype hello
this will send 'hello' to the active window as a sequence of keyboard events
Hope this helps!
from xdotool.
from xdotool.
from xdotool.
Related Issues (20)
- Impossible to chain "open thunderbird" + "resize window" HOT 2
- xdotool mousemove does not work on fc38
- Random mistake with type command
- Trouble getting xdo_click_window() function to work
- xdotool will not launch on Mint 21.2 Cinnamon
- xdotool key Alt+Tab on Ubuntu, not switch app window
- xdotool sets _NET_WM_NAME as a STRING when it needs to be set as UTF8_STRING
- Extremely strange bug - see attached video. HOT 2
- Add various random timing capabilities
- [Feature] Ability to query and change desktop names
- [Feature] Search for windows that are unmapped or visible on all desktops HOT 1
- Latest xdotool version in Ubuntu 22 repos silently fails on Wayland :sob: apt can't upgrade it, and manual doesn't help HOT 2
- Segfault when running over an ssh connection
- set_desktop --relative does not work for -1 HOT 2
- xdotool cannot send key combinations to Qt-based applications HOT 5
- XGetInputFocus returned the focused window of 1. This is likely a bug in the X server. HOT 1
- Search not seeing Steam Input On-Screen Keyboard HOT 7
- The character ":" is typed as "Q" in VM window HOT 1
- Xdotool works in Firefox but not Brave HOT 1
- behave_screen_edge only works with certain open windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdotool.