sebanc / brunch

Boot ChromeOS on x86_64 PC - Supports Intel CPU/GPU from 8th gen or AMD Ryzen
GNU General Public License v3.0
3.69k stars 393 forks source link

Lenovo Ideapad Yoga 13 Tablet Mode #1119

Open utkabobr opened 3 years ago

utkabobr commented 3 years ago

Using rammus image, chrome os 90.0.4430.218, brunch r90 stable 20210523, Lenovo Ideapad Yoga 13 Options: options=pwa,advanced_als,acpi_power_button,internal_mic_fix,android_init_fix

After some research found that it uses special keyboard keycode instead of sensors. Dmesg keeps repeating this when folded into tablet mode:

[17536.285076] atkbd serio0: Unknown key pressed (translated set 2, code 0xbe on isa0060/serio0).
[17536.285086] atkbd serio0: Use 'setkeycodes e03e <keycode>' to make it known.
[17536.289293] atkbd serio0: Unknown key released (translated set 2, code 0xbe on isa0060/serio0).
[17536.289302] atkbd serio0: Use 'setkeycodes e03e <keycode>' to make it known.

Also found linux script to monitor it: https://gist.github.com/emiller/6488449

Thanks in advance!

librehat commented 2 years ago

This seems to be how Samsung implemented its tablet mode detection too.

[  172.552723] atkbd serio0: Use 'setkeycodes e02c <keycode>' to make it known.
[  172.675819] atkbd serio0: Unknown key released (translated set 2, code 0xac on isa0060/serio0).
[  172.675831] atkbd serio0: Use 'setkeycodes e02c <keycode>' to make it known.

I also found this project where Arch Linux has packaged for tablet mode detection https://github.com/alesya-h/linux_detect_tablet_mode