ysl2 / .dotfiles

My dotfiles
1 stars 0 forks source link

Disable laptop's touchpad and keyboard by xinput #48

Open ysl2 opened 3 months ago

ysl2 commented 3 months ago

Ref: https://bbs.archlinuxcn.org/viewtopic.php?id=10561

  1. First, we need to find the touchpad and keyboard's id.
❯ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ OBINS OBINS
AnnePro2 Mouse                  id=13   [slave  pointer  (2)]
⎜   ↳ YICHIP Wireless Device Mouse              id=14   [slave  pointer  (2)]
⎜   ↳ YICHIP Wireless Device Consumer Control   id=16   [slave  pointer  (2)]
⎜   ↳ SYNA3073:00 06CB:8265 Mouse               id=17   [slave  pointer  (2)]
⎜   ↳ SYNA3073:00 06CB:8265 Touchpad            id=18   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=20   [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)]
    ↳ OBINS OBINS
AnnePro2                        id=10   [slave  keyboard (3)]
    ↳ OBINS OBINS
AnnePro2 Consumer Control       id=11   [slave  keyboard (3)]
    ↳ OBINS OBINS
AnnePro2 Keyboard               id=12   [slave  keyboard (3)]
    ↳ YICHIP Wireless Device System Control     id=15   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=19   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                            id=21   [slave  keyboard (3)]
    ↳ YICHIP Wireless Device Consumer Control   id=22   [slave  keyboard (3)]

In the command output above, the SYNA3073:00 06CB:8265 Touchpad id=18 is the touchpad, and the AT Translated Set 2 keyboard id=19 is the keyboard.

  1. Then, we use the command below to disable:
# Disable the touchpad
xinput disable 18
# Disable the keyboard
xinput disable 19
  1. If we want to re-enable, just use xinput enable {id}.