This forum has been archived. All content is frozen. Please use KDE Discuss instead.

touchpad keyboard disable foldable 2-in-1 laptop tablet

Tags: None
(comma "," separated)
kur-ka
Registered Member
Posts
7
Karma
0
OS
I would like to manage touchpad and keyboard switching of a foldable laptop tablet with touchscreen. Currently this device's behavior is:
  • screen open: touchpad on, keyboard on, touchscreen on
  • screen folded back: touchpad off, keyboard off, touchscreen on
I would like to reconfigure it to:
  • screen open: touchpad on, keyboard on, touchscreen on
  • screen folded back: touchpad on, keyboard on, touchscreen off
Code: Select all
System:
  Kernel: 5.17.2-artix3-1 arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    Desktop: KDE Plasma v: 5.24.4 Distro: Artix Linux base: Arch Linux
Machine:
  Type: Convertible System: HP product: HP Pavilion x360 Convertible
    v: Type1ProductConfigId serial: <superuser required>
  Mobo: HP model: 81A7 v: 52.28 serial: <superuser required> UEFI: Insyde
    v: F.36 date: 11/15/2018

Is there any setting responsible for inputs on off according to the laptop lid position?
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
This will heavily depend on how the hardware switching is handled. It very well could be something handled at the hardware board level, and not controllable by the OS at all.

My last laptop, a Lenovo, physically disabled touchpad and keyboard input, though the OS reported them as both enabled.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
I also do not know how this is handled by HP. Do you have the iio-sensor-proxy package installed? Then you could use `monitor-sensor` to watch which events are emitted.

If not you can check for iio-sensors using
Code: Select all
cat /sys/bus/iio/devices/iio*/name

which will print the known sensors. Sensor detection normally requires firmware to be installed.

If the iio-sensor-proxy is installed you can watch the changes via DBus-PropertyChanged-signal and enable/disable your devices accordingly.
kur-ka
Registered Member
Posts
7
Karma
0
OS
koffeinfriedhof wrote:

Wow, there is a hinge!

Since I can't see any iio-sensor-proxy available, is it not only for accelerometer? Can you please explain how could I enable/disable devices with the method you have mentioned?
Code: Select all
$ cat /sys/bus/iio/devices/iio*/name
incli_3d
hinge
incli_3d
gyro_3d
magn_3d
gyro_3d
accel_3d
dev_rotation
magn_3d
accel_3d
dev_rotation

$ pacman -Ss iio
community/iio-sensor-proxy 3.3-1
    IIO accelerometer sensor to input device proxy

$ pacman -Ss sensors
world/lm_sensors 1:3.6.0.r41.g31d1f125-1 [installed]
    Collection of user space tools for general SMBus access and hardware monitoring
world/lm_sensors-runit 20180226-4 (runit-world)
    runit service scripts for lm_sensors
world/plasma-systemmonitor 5.24.4-1 (plasma) [installed]
    An interface for monitoring system sensors, process information and other system resources
world/qt5-sensors 5.15.3+kde+r0-1 (qt qt5) [installed]
    Provides access to sensor hardware and motion gesture recognition
world/qt6-sensors 6.3.0-1 (qt6)
    Provides access to sensor hardware and motion gesture recognition
world/xfce4-sensors-plugin 1.4.3-1 (xfce4-goodies)
    Sensors plugin for the Xfce panel
galaxy/i2c-tools 4.3-3
    Heterogeneous set of I2C tools for Linux that used to be part of lm-sensors
galaxy/mate-sensors-applet 1.26.0-1 (mate-extra)
    A MATE Panel applet to display readings from hardware sensors, including CPU temperature,
    fan speeds and voltage readings
galaxy/plasma5-applets-thermal-monitor 1.3.0-2
    Plasma applet for monitoring temperatures of existing sensors including CPU, GPU and HDD.
extra/lm_sensors 1:3.6.0.r41.g31d1f125-1 [installed]
    Collection of user space tools for general SMBus access and hardware monitoring
extra/plasma-systemmonitor 5.24.4-1 (plasma) [installed]
    An interface for monitoring system sensors, process information and other system resources
extra/qt5-sensors 5.15.3+kde+r0-1 (qt qt5) [installed]
    Provides access to sensor hardware and motion gesture recognition
extra/qt6-sensors 6.3.0-1 (qt6)
    Provides access to sensor hardware and motion gesture recognition
extra/xfce4-sensors-plugin 1.4.3-1 (xfce4-goodies)
    Sensors plugin for the Xfce panel
community/i2c-tools 4.3-3
    Heterogeneous set of I2C tools for Linux that used to be part of lm-sensors
community/mate-sensors-applet 1.26.0-1 (mate-extra)
    A MATE Panel applet to display readings from hardware sensors, including CPU temperature,
    fan speeds and voltage readings
community/plasma5-applets-thermal-monitor 1.3.0-2
    Plasma applet for monitoring temperatures of existing sensors including CPU, GPU and HDD.
community/sensors-applet 3.0.0+13+g0728426-5
    Applet for GNOME Panel to display readings from hardware sensors, including CPU
    temperature, fan speeds and voltage readings
community/xsensors 0.80-3
    X11 interface to lm_sensors - Mystro256 fork
multilib/lib32-lm_sensors 1:3.6.0.r41.g31d1f125-1
    Collection of user space tools for general SMBus access and hardware monitoring (32-bit)

koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Please do only list installed packages, not all available (pacman -Qs).

Disabling devices can be done using udev. For the touchpad there should be a DBus-method available, depending on the controller/driver used (e.g. i2c_hid).
The iio-sensor-proxy itself provides a dbus-interface.
Code: Select all
qdbus --system net.hadess.SensorProxy /net/hadess/SensorProxy org.freedesktop.DBus.Properties.GetAll net.hadess.SensorProxy
lists all available properties. But you cannot claim/release those devices using qdbus/shell. Depending on what language you know there are DBus-bindings for all major languages. For shellscripts you may try `busctl`, but I never did it.

Disabling things can be a bit complicated as it depends on the running processes. Gnome uses glib-dbus, Plasma has another implementaion, so you have to check the available busses for methods. On my machine, I can disable e.g. auto-rotation for Plasma using
Code: Select all
qdbus org.kde.kded5 /modules/kscreen setAutoRotate false

Tabletmode can be found at `qdbus org.kde.kded5 /Tablet`, the virtual keyboard (I'm using maliit) at `qdbus org.kde.keyboard /VirtualKeyboard`. Connecting to signals again depends on your chosen language.

Easiest here is also watching the monitor for getting dbus signals and methods, like for the monitor-sensor. DBus monitor is available as `dbus-monitor`.

/edit: If you do not have any interesting dbus-signals, consider switching to acpi/libinput and run as root `libinput debug-events`
kde-orionvii
Registered Member
Posts
1
Karma
0
Hello,
Can you explain to me how you managed screen rotation. My System runs on HP X360 15" convertible with Kubuntu 22.04.1.

Tx from Portugal
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
kde-orionvii wrote:Hello,
Can you explain to me how you managed screen rotation. My System runs on HP X360 15" convertible with Kubuntu 22.04.1.

Tx from Portugal



Log in to a Wayland session.
You *might* need to un-check the 'only in tablet mode' option for auto-rotate settings.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]