想必你們都經歷過這樣的狀況:在使用usb接口的外接鍵盤的時候,很容易按到筆記本自帶的鍵盤,從而致使輸入錯誤。尤爲是你將外接鍵盤放在筆記本鍵盤上面的時候。怎麼解決這個問題呢?html
搜索以後,找到了答案。注意,這是在ubuntu linux下的解決方法。並不適用於windows。linux
使用xinput命令便可完美解決ubuntu
step 1:使用xinput list
找到筆記本鍵盤的ID
能夠看到,在個人機器上, AT Translated Set 2 Keyboard項的ID爲15。windows
step 2:使用xinput set-prop 15 "Device Enabled" 0
來禁用筆記本鍵盤。若是要從新啓用它,則將0更改成1便可。less
xxx@X550VX:~$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ RAPOO Rapoo 2.4G Wireless Device id=11 [slave pointer (2)] ⎜ ↳ SIGMACHIP USB Keyboard id=13 [slave pointer (2)] ⎜ ↳ FocalTechPS/2 FocalTech FocalTech Touchpad id=16 [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)] ↳ Video Bus id=8 [slave keyboard (3)] ↳ Sleep Button id=9 [slave keyboard (3)] ↳ USB2.0 VGA UVC WebCam id=10 [slave keyboard (3)] ↳ SIGMACHIP USB Keyboard id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=15 [slave keyboard (3)] xxx@X550VX:~$ xinput set-prop 15 "Device Enabled" 0 xxx@X550VX:~$ xinput set-prop 15 "Device Enabled" 1 xxx@X550VX:~$ xinput set-prop 15 "Device Enabled" 0 xxx@X550VX:~$
原文連接:ide
http://www.th7.cn/system/lin/201604/160018.shtmlspa