alesya-h / linux_detect_tablet_mode

Detect if your laptop is in normal or tablet mode. Useful for Yoga laptops to disable keyboard/trackpoint/touchpad in a tablet mode
MIT License
136 stars 28 forks source link

Yoga 11e event source? #31

Open singpolyma opened 11 months ago

singpolyma commented 11 months ago

I am running a Yoga 11e which the readme implies has been tested with this script, but I can't figure out where the event should come from. Any of the monitoring commands I run, nothing seems to print when I fold the laptop to tablet mode.

I got something working based on the old version in git history using accelerometers and that works fine, but I guess probably that approach was stopped because you need to poll often and it can suck battery?

Thanks for any tips about this.

alesya-h commented 3 months ago

I didn't test it personally, here's the pull-request where it was added https://github.com/alesya-h/linux_detect_tablet_mode/pull/30/files . It specifically mentions 11e gen6 , so you might have a different device.

As for the older approach, no, it was sunset because modern laptops standardised on using this event, and before that using a pair of accelerometers was an implementation detail for some Lenovo laptops (maybe some others too), when this event wasn't issued by the kernel. Once this event became supported on my laptop I made the current version of the script because it seemed both simpler and more generic. If the old version works for you it's great, that's why I kept it around.