Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
225
rated 0 times [  225] [ 0]  / answers: 1 / hits: 181565  / 1 Year ago, sun, november 27, 2022, 11:08:57

A week ago, I spilt the contents of my cup onto my laptop keyboard. Half of the keys no longer work, except one! The letter Q which is very active regularly.



This is very disturbing as I work.



Is there a way to disable the internal keyboard of a laptop?



Is it possible with xmodmap?


More From » keyboard

 Answers
7

You can use xinput to float the input device under X.




  1. Execute the command xinput list to list your input devices.

  2. Locate AT Translated Set 2 keyboard and take note of its id number; this will be used to disable the keyboard. Also, take note of the number at the end, [slave keyboard (#)]; this is the id number of the master, which will be used to re-enable your keyboard.

  3. To disable the keyboard, execute the command xinput float <id#>, where <id#> is your keyboard's id number. For example, if the id was 10, then the command would be xinput float 10.

  4. To re-enable the keyboard, execute the command xinput reattach <id#> <master#>, where master is that second number we noted down. So if the number was 3, you would do xinput reattach 10 3.



Here's a demonstration:




$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ Logitech USB-PS/2 Optical Mouse id=12 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:4004 id=13 [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)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Acer CrystalEye webcam id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
$ xinput float 10
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ Logitech USB-PS/2 Optical Mouse id=12 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:4004 id=13 [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)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Acer CrystalEye webcam id=9 [slave keyboard (3)]
∼ AT Translated Set 2 keyboard id=10 [floating slave]
$ xinput reattach 10 3
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ Logitech USB-PS/2 Optical Mouse id=12 [slave pointer (2)]
⎜ ↳ Logitech Unifying Device. Wireless PID:4004 id=13 [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)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Acer CrystalEye webcam id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]

[#37025] Sunday, November 27, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rvousnove

Total Points: 456
Total Questions: 130
Total Answers: 98

Location: El Salvador
Member since Sun, Sep 12, 2021
3 Years ago
;