PINE64

Full Version: Disabling PineTab2 physical keyboard and touchpad?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
I don't have my PineTab2 right now to test it, but how about this?
https://superuser.com/questions/1707773/...f-in-linux
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.

Thanks!

-john
Well, that was shortlived. Two things went wrong while trying to do this in practice.

1) Folding the case back after the usb device is unbound puts the device into suspend after only some seconds

2) Trying to rebind the device after a few minutes gives "usb 2-1: can't set config #1, error -62"

Further suggestions welcome..
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.
On IRC, someone said it's a hall effect sensor, with magnet under the CTRL key.
I managed to "disable" the keyboard on my PineTab2 following the instructions here:
https://unix.stackexchange.com/questions...wer-382225

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.

Let me know if this solutions works better for you.

Hey! Found out another possible solution based on this question here:
https://unix.stackexchange.com/questions...the-laptop

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.