kitakar5525 / chromeos-kernel-linux-surface

linux-surface kernel for chromiumos.
GNU General Public License v3.0
18 stars 1 forks source link

Auto mode change into tablet_mode not working #6

Closed kitakar5525 closed 4 years ago

kitakar5525 commented 4 years ago

While auto mode change is not working, you can manually change the mode by keyboard.

To do so, add a flag --ash-debug-shortcuts to your /etc/chrome_dev.conf, then restart your ui sudo restart ui, after that, you can change the mode by Ctrl+Alt+Shift+T.

# mount root filesystem as writable
sudo mount / -o rw,remount
# Edit this file
sudo vim /etc/chrome_dev.conf
kitakar5525 commented 4 years ago

Note here that current chromeos (iirc, after version 79) cannot change the mode by the aforementioned keyboard shortcut with --ash-debug-shortcuts.

Currently , I always use chromeos in tablet mode:

# add this flag to /etc/chrome_dev.conf
--force-tablet-mode=touch_view
kitakar5525 commented 4 years ago

Addressed this issue by tablet_mode switching drivers either by sysfs (https://github.com/kitakar5525/linux-surface-kernel/commit/95227f0d35dd8c1cb5f751829205cd41346c9f9a) or tweaking usbcore (https://github.com/kitakar5525/linux-surface-kernel/commit/d69100b52b1760e6c0c1e09567aa8a5a2e3ffb93) (thanks to sebanc)

leaving here the usage of sysfs version on Chromium OS:

# modprobe the module
sudo modprobe tablet_mode_switch

# option_1: create udev rule and add your keyboard id
# take a look at this file: https://github.com/sebanc/brunch/blob/65762577f0ba25d209c57cb65460ad606482eed1/patches/99-tablet_mode.sh#L20-L23

# option_2: if you didn't add the udev rule, enable it manually on every boot
echo 1 | sudo tee /sys/bus/platform/devices/tablet_mode_switch.0/tablet_mode

usbcore version just works on supported devices (https://github.com/kitakar5525/linux-surface-kernel/blob/d69100b52b1760e6c0c1e09567aa8a5a2e3ffb93/drivers/usb/core/surface_tablet_mode.c#L59-L117) but I may not include this patch on my prebuilt releases.