也许另一个解决方案可以解决问题:
您可以创建一个面板启动器,它运行一个 shell 脚本来禁用鼠标输入和一个键盘快捷键来启用鼠标输入。
您可以使用 xinput 管理 X-Server 的输入设备。使用以下命令,您可以列出所有输入设备:
xinput --list
Run Code Online (Sandbox Code Playgroud)
找到鼠标右键设备并禁用它:(将[ID]替换为正确的ID号)
xinput --set-prop [ID] 'Device Enabled' 0
Run Code Online (Sandbox Code Playgroud)
再次启用它:
xinput --set-prop [ID] 'Device Enabled' 1
Run Code Online (Sandbox Code Playgroud)
要模拟您希望的工具的行为,您可以创建一个 shell 脚本来一次性禁用/启用所有鼠标指针设备。
鼠标:
#!/bin/sh
# setmouse 0 to disable mouse
# setmouse 1 to enable mouse
for id in $(xinput --list | grep -E "slave.*pointer" | cut -f2 | cut -d"=" -f2)
do
xinput set-prop $id 'Device Enabled' $1
done
Run Code Online (Sandbox Code Playgroud)
然后,您可以创建一个运行“setmouse 0”的 (Xfce-)Panel 启动器以禁用鼠标输入,并创建一个运行“setmouse 1”的键盘快捷键以再次启用它。
| 归档时间: |
|
| 查看次数: |
555 次 |
| 最近记录: |