0

(base) art_usr@artem--ubuntu:~$ xinput --list

On HP x360 specter running Ubuntu 22.04 results in the following output, no matter if my external USB keyboard is plugged in or not. There is no AT Translated Set 2 keyboard device as suggested in this post. Any idea what id would I use if I want to disable internal keyboard?

WARNING: running xinput against an Xwayland server. See the xinput man page for details.
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer:18                       id=6    [slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:18              id=7    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer-gestures:18              id=8    [slave  pointer  (2)]
⎜   ↳ xwayland-touch:18                         id=10   [slave  pointer  (2)]
⎜   ↳ xwayland-tablet stylus:18                 id=11   [slave  pointer  (2)]
⎜   ↳ xwayland-tablet eraser:18                 id=12   [slave  pointer  (2)]
⎜   ↳ xwayland-tablet cursor:18                 id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ xwayland-keyboard:18                      id=9    [slave  keyboard (3)]

1 Answers1

0
sudo apt-get install libinput-tools
libinput list-devices

Then find the "AT Translated Set 2 keyboard" event number(4 for me).

Trying with the inhibited File

The inhibited file you mentioned in the directory listing might be used to block input from the device temporarily. This is not a standard method and its behavior can depend heavily on the specific drivers and kernel version you are using, but you can attempt to write to this file to see if it inhibits the keyboard input:

ls -l /sys/class/input/event4/device/inhibited

Attempt to write to the inhibited file:

echo 1 | sudo tee /sys/class/input/event4/device/inhibited

Since the inhibited method worked for disabling your keyboard, you can automate this process using a systemd service to ensure it’s applied every time your system starts.

sudo nano /etc/systemd/system/disable-keyboard.service

Add the following content to the service file. This script will write ‘1’ to the inhibited file on your device at startup: [Unit]

Description=Disable internal keyboard at startup

[Service]

Type=oneshot

ExecStart=/bin/sh -c 'echo 1 > /sys/class/input/event4/device/inhibited'

[Install]

WantedBy=multi-user.target

Save and exit the editor. In nano, you can do this by pressing CTRL+X, then Y to confirm saving, and Enter to write to the file.

sudo systemctl daemon-reload
sudo systemctl enable disable-keyboard.service

when I restart my computer, it work.

SNW
  • 1