WeirdTreeThing / cros-keyboard-map

Utility to generate keyd configurations for use on Chromebooks
BSD 3-Clause "New" or "Revised" License
33 stars 10 forks source link

Investigate `ModelTabletModeNoSuspend=1` #19

Open ChocolateLoverRaj opened 3 months ago

ChocolateLoverRaj commented 3 months ago

I'm not sure if this is from using keyd v2 vs v1, or if it's a redrix vs jinlon thing, but ModelTabletModeNoSuspend=1 is now messing up stuff.

With ModelTabletModeNoSuspend=1:

Without ModelTabletModeNoSuspend=1:

Tested in NixOS. I'm not using this script, but maybe someone should investigate this option on another Chromebook and undo my earlier pr if needed

crystalcommunication commented 1 month ago

I think this is going to be a per-device problem. I have a few convertible models to test.

(key: ✅ = enabled, ❌ = disabled. note that the 'correct' configuration is ✅ in the second column and ❌ in the third column)

with ModelTabletModeNoSuspend=1... Device Volume Rocker Keyboard
MORPHIUS
VAYNE
LAVA

Notably, the tablet mode switch on my LAVA doesn't even work properly in Linux. GNOME does not activate tablet mode (automatically enable OSK and disable trackpad) but the board's embedded controller must be disabling the keyboard without the operating system's interference because that works fine.

without ModelTabletModeNoSuspend=1... Device Volume Rocker Keyboard
MORPHIUS
VAYNE
LAVA

I know I said the tablet switch on my LAVA doesn't work. It is detected, it's state is just not updated properly when the hinges fold. When the device boots, wakes from sleep, or switches virtual terminals, the state does update. Not only does this break the volume rocker, it also prevents you from shuffling the virtual terminal to get your trackpad back by disabling the keyboard if it gets stuck in tablet mode.

For devices like MORPHIUS on which neither solution produces the desired result, I wrote this script which swaps the keyd config to one that rebinds each individual key to a noop, it works great and adapting it to other Chromebooks should be very easy.

ChocolateLoverRaj commented 1 month ago

Maybe we should use ectool to find out if the EC is detecting tablet mode properly. If it is, then maybe this can properly be fixed with changes to the Linux kernel.