Xdotool不能与xbindkeys一起使用
我想将xdotool与xbindkeys一起使用,但它不起作用。
这是我首先尝试的:
"xdotool type a" m:0x1 + c:50 Shift + Shift_L
这不是重复,因为我也尝试过其他问题的解决方案:
"sleep 1 && xdotool type --delay 15 'a'" m:0x1 + c:50 Shift + Shift_L
和
"xset r off; xdotool type --window 0 a; xset r on" m:0x1 + c:50 Shift + Shift_L
我知道xbindkeys工作正常,因为我可以用它执行echo test > /home/dalton/key.txt
。
-
xbindkeys
的默认设置是捕获Press
事件。 它捕获Shift + Shift_L
然后xdotool
生成a
键击。 我们得到:Shift + Shift_L + a
与按下类似: Shift_R + Shift_L + a (按此顺序)
-
这些解决方案对我有用:
在新闻发布会上
"xdotool keyup Shift_L keyup Shift_R key a keydown Shift_R" m:0x1 + c:50 Shift + Shift_L
在发布活动上
"xdotool keyup Shift_R key a keydown Shift_R" Release + m:0x1 + c:50 Release + Shift + Shift_L
也可以使用小的预延迟,但这不是完美的方法。
参考: xbindkeys + xdotool计时问题