歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu下的按鍵精靈xdotool

Ubuntu下的按鍵精靈xdotool

日期:2017/2/28 16:21:11   编辑:Linux教程

Ubuntu下安裝方法

輸入以下命令:

sudo apt-get install xdotool

軟件首頁:http://www.semicomplete.com/projects/xdotool/

若干基本用法:

xdotool mousemove x y

將鼠標移動到在屏幕上特定的X和Y坐標位置

xdotool click 1

點擊鼠標左鍵,1表示左鍵,2表示中鍵,3表示右鍵。

xdotool key ctrl+l

同時按下ctrl和l鍵

更多命令詳解請輸入:man xdotool

這個工具沒有內置延時和循環功能。不過linux下提倡的就是一個軟件做一件事,這個功能只要稍微組合一下就能實現了。

舉個例子:

如果要鼠標每隔10秒點擊左鍵一次

我們可以用終端下的watch命令組合實現

watch -n 10 xdotool click 1

Copyright © Linux教程網 All Rights Reserved