2

I have an HP ENVY 13-ay0000 x360 Convertible Laptop with an AMD Ryzen 5 4500U CPU running Ubuntu 22.10. The auto-rotation is not working, and the keyboard and touchpad are only disabled if the laptop is folded completetly backwards, but not in between. I believe it's due to this bug: https://bugzilla.kernel.org/show_bug.cgi?id=212615.

As a workaround, I was trying to rotate the screen and disable the keyboard manually through a script or something of the sort. The screen rotation and touchpad disabling I managed to get working but I'm struggling to figure out how to disable and reenable the keyboard. Using xinput does not work as I'm using wayland. I checked this thread: https://unix.stackexchange.com/questions/381944/how-to-disable-internal-keyboard-on-fedora-26-wayland

But neither solution worked as I need to disable and reenable on demand and not permanently. I tried grabbing the keyboard events but this results in the touchscren and touchpad behaving erratically.

Any ideas on how this could be achieved?

lzilhao
  • 21

1 Answers1

1

For users with xwayland, first find the event id.

$ libinput list-devices

If needed install the libinput (sudo apt install libinput-tools). This will listdonw all the input devices and its event id. Scroll to find the right section (Something like "AT Translated Set 2 keyboard") and find the line Kernel: /dev/input/event#. Use the event# for the next command:

$ udevadm info -a -p /sys/class/input/event#

Find an attribute that is most probably unique/distinct. For example ATTRS{name}=="AT Translated Set 2 keyboard" and then create rule file

sudo nano /etc/udev/rules.d/99-disable_touchscreen.rules

with following rule

KERNEL=="event*", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"

Then check if it worked by following command:

$ udevadm test /sys/class/input/event#

and search for

LIBINPUT_IGNORE_DEVICE=1

most probably within the last 3 lines. Then reboot and your intenral keyboard should be disabled.

Courtesy: https://wiki.archlinux.org/title/Dell_XPS_13_(9343)#Disable_the_touchscreen

OmaL
  • 271