I'd like to keep the PT2 in the case, but sometimes fold the keyboard back and use only touch input. My first thought was to try to write a desktop launcher using xinput, but I see that xinput does not work with Wayland. Any advice for how to accomplish this?
Realized that disabling the touchpad is very easy, just use the Fn-F7 shortcut.
dmesg confirms the keyboard as usb 2-1.
From the link you gave, "echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/unbind" and "echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/bind" do work to disable and enable the keyboard+trackpad, thanks!
It would still be nice to have a solution that did not require root/sudo. Since this won't work easily as a desktop launcher, which is my goal.
Also learned about libinput list-devices and libinput list-kernel-devices which might be helpful for a different approach.
I read about one way of just starting evtest to grab all the input from the specified device, effectively disabling it, but that's very hacky and an unnecessary background process.
07-31-2023, 07:55 AM (This post was last modified: 07-31-2023, 07:58 AM by Conjada.)
I don't have experience in this area. But, it would be helpful to know what kind of sensor is detecting the magnet in the lid. For example, if it is a reed switch and is SPST, there is no way to detect whether the lid is closed or flipped back. But, if it is a hall effect of some sort, you might be able to detect the polarity of the magnetic field and determine whether the lid is flipped back or closed. If hardware can detect polarity, the rest is just software.
Pinephone Pro enthusiast and SUPER-HYPED for PineTab 2! PT2 is AWESOME!
Former electrical engineer. Current rancher.
I know a lot about a few things, a little about a lot of things and am ignorant of an unknown number of things.
Not sure if the event number is the same for all PineTabs, but in mine the command is:
sudo evtest --grab /dev/input/event4
the problem with this is that you (1) either have to keep your terminal opened or (2) background the evtest job and it will be running on the background until you kill it. I also noticed that when I fold the keyboard backwards the tablet does want to go to suspend but I can get off it.
So, in my PineTab2, the command is
sudo sh -c 'echo 1 > /sys/devices/platform/fd840000.usb/usb/4/4-1/4-1\:1.0/0003\:1018\:1006.0003/input/input15/inhibited'
and do enable:
sudo sh -c 'echo 0 > /sys/devices/platform/fd840000.usb/usb/4/4-1/4-1\:1.0/0003\:1018\:1006.0003/input/input15/inhibited'
but make sure to check the correct input path on /proc/bus/input/devices
ok, one last thing. Have you seen this option on System Settings > Power Management > Energy Saving > When laptop lid closed? When I select "do nothing" the screen doesn't go to sleep if I fold back the keyboard.