ubuntu禁用笔记本自带键盘

时间:2023-12-24 17:56:07

ubuntu如何禁用笔记本键盘

打开终端运行命令 xinput list

Virtual core pointer                        id=2    [master pointer  (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ BTL Gaming Mouse id=10 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=17 [slave pointer (2)]
⎜ ↳ USB USB Keyboard id=14 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ BTL Gaming Mouse id=11 [slave keyboard (3)]
↳ Lenovo EasyCamera id=12 [slave keyboard (3)]
↳ Ideapad extra buttons id=15 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=16 [slave keyboard (3)]
↳ USB USB Keyboard id=13 [slave keyboard (3)]

找出你的笔记本键盘id,在我电脑上类似这样:

↳ AT Translated Set 2 keyboard              id=16   [slave  keyboard (3)]

然后执行

//xinput set-prop <id> "Device Enabled" 0
xinput set-prop 16 "Device Enabled" 0