Sending keyboard input to a program from command-line

后端 未结 4 1322
轻奢々
轻奢々 2021-02-01 23:44

How do you send keyboard input to a program?

That is, under a Linux GUI, is there a good manual (programmable) way, or tool, of simulating keyboard input on a running pr

4条回答
  •  长发绾君心
    2021-02-02 00:38

    It's an old topic, but one still may be looking for this, someone mentioned here solution where window must be activated when using xdotool. However you can specify window and even use xdotool to find it. Here is example I tried to accomplish, change it as you need.

    xdotool key --window $(xdotool search --name "Spotify (Premium |Free )?- Linux Preview" | head -n1) ctrl+KP_Down
    

提交回复
热议问题