Sending keyboard input to a program from command-line

后端 未结 4 1318
轻奢々
轻奢々 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:29

    xdotool does have a way of sending keystrokes if limited to a focused window:

    WID=`xdotool search "Mozilla Firefox" | head -1`
    xdotool windowactivate $WID
    xdotool key ctrl+l
    

提交回复
热议问题