我可以使用以下方法禁用键盘或鼠标:
xinput disable <device>
Run Code Online (Sandbox Code Playgroud)
但是我怎么知道一个设备以前是否在命令行中被禁用?
手册页说:
--disable device
Disable the device. This call is equivalent to
xinput --set-prop device "Device Enabled" 0
Run Code Online (Sandbox Code Playgroud)
因此,您可以使用xinput --list-props
和grep
来确定设备是否已启用。