xdotool教程

7次阅读
没有评论

xdotool

鼠标

xdotool click 1
#左键单击
xdotool click 2
#中键单击
xdotool click 3
#右键单击
xdotool click 4
#滚轮向上
xdotool click 5
#滚轮向下
xdotool click --repeat 2 1
#左键双击
xdotool mousedown 1 mousemoe 600 600 mouseup 1
#左键拖动
xdotool getmouselocation 
#获取鼠标位置
xdotool mousemove x y
#鼠标移动,绝对位置
xdotool mousemove_relative x y
#鼠标移动,相对位置

键盘

xdotool type "hello wordl!"
# 输入多行文本
xdotool key ctrl+a
#组合快捷键
xdotool key Return
#回车

窗口

xdotool search --name "Firefox" windowactive
#查账窗口并激活
xdotool getactivewindow windowsmove 100 100
#移动激活窗口
xdotool getactivewindow windowsize 800 600
#激活窗口改变大小
正文完
 0
评论(没有评论)