Some convertible systems send a SW_TABLET_MODE key with a value of 1 or 0 to indicate if there is a physical keyboard present. It would be nice to adapt the system to that. For instance, bringing up an OSK when no physical keyboard is present and text input is required. Testing ... (interrupt to exit) Event: time 1415830290.595756, type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 1 Event: time 1415830290.595756, -------------- SYN_REPORT ------------ Event: time 1415830353.295884, type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 0 Event: time 1415830353.295884, -------------- SYN_REPORT ------------
https://bugzilla.gnome.org/show_bug.cgi?id=740037
logind doesn't actually expose the lid status directly to third-party applications, and UPower only exposes lid status because it itself needed it to make power related decisions. Seeing as UPower doesn't use the lid status internally anymore, there's a good chance it will get removed from UPower, and a better place would be somewhere in the session. Which is where we could put the tablet mode status as well. Reassigning to libinput to keep track, and expose SW_LID and SW_TABLET_MODE values to compositors. I'll file a bug against gnome-shell as well.
IMO the best approach for this in libinput would be to add it to the buttonset interface that we're working on anyway. As a separate event/interface for switches. Would that work for you? The other option that came up in a related discussion: would it be worth having a small daemon that provides that value over dbus to the session or whatever needs it? instead of providing it through libinput.
(In reply to Peter Hutterer from comment #3) > IMO the best approach for this in libinput would be to add it to the > buttonset interface that we're working on anyway. As a separate > event/interface for switches. Would that work for you? That would work for me. > The other option that came up in a related discussion: would it be worth > having a small daemon that provides that value over dbus to the session or > whatever needs it? instead of providing it through libinput. I've discounted adding yet another daemon because this is only really useful to the compositor itself. If it's needed within the session, the compositor can export it.
fwiw, there's a patch set as RFC on the list, any comments are appreciated: http://lists.freedesktop.org/archives/wayland-devel/2016-January/026349.html
updated patchset: https://lists.freedesktop.org/archives/wayland-devel/2017-January/032540.html
missing SW_TABLET_MODE until we have a concrete use case for it commit 45d7794de2fb8c24fddd5cd91d946900e4bb4495 Merge: 65c4b27 2dc6534 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Feb 1 13:56:32 2017 +1000 Merge branch 'wip/switch-interface
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.