You are not logged in.

#1 2019-03-22 17:17:17

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,972
Website

[workaround] Disable devices with libinput

I cannot find a working solution to conditionally deactive/activate libinput controlled devices.
I am using Gnome3 with Wayland and want to conditionally deactivate my laptop's keyboard and touchpad when in tablet mode.
I tried using xinput, but this will only disable the virtualized device for applications that use the Xorg backend, eg. chromium.
Other applications like gnome-terminal however will still receive working keyboard input.
How can I completely deactivate and later reactivate all keyboard and touchpad input?

Last edited by schard (2019-03-23 12:45:59)


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#2 2019-03-22 18:50:59

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [workaround] Disable devices with libinput

AFAIK this hasn't been implemented by mutter yet, so a different approach is needed.

One option may be to use evtest to grab all events from the relevant device(s) so the kernel doesn't pass them on.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-03-22 19:13:25

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [workaround] Disable devices with libinput

I believe normally libinput should handle that automatically if it detects a tablet mode switch. If you don't have a tablet mode switch, it might be possible to simulate it with uinput.

https://wayland.freedesktop.org/libinpu … h-handling

Last edited by progandy (2019-03-22 19:14:25)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2019-03-23 12:45:41

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,972
Website

Re: [workaround] Disable devices with libinput

Thanks to you both. It seems, that the kernel does not yet detect the tablet mode sensor. Probably the device is too new and nobody has written a driver for it yet.
The hint with evtest allowed me to create a workaround.
Basically I've written a systemd unit that runs the tablet mode via evtest --grab, a script toggling the service and a custom desktop entry to have a button in Gnome.
Should I put this here or start a Wiki article on this particular Notebook?
Update:
I created a package with the software: https://bbs.archlinux.org/viewtopic.php?pid=1838472

Last edited by schard (2019-03-23 13:37:16)


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#5 2019-03-23 20:24:08

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [workaround] Disable devices with libinput

Can you tell us the name of your foldable laptop?


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2019-03-24 10:04:36

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,972
Website

Re: [workaround] Disable devices with libinput

It's an HP ENVY x360 13-ag0005ng.
Update:
I did some more research. The sensors in question do not yet have driver support.
The respective Kernel feature request can be found here:
https://bugzilla.kernel.org/show_bug.cgi?id=199715

Last edited by schard (2019-04-04 19:10:36)


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

Board footer

Powered by FluxBB