detecting tablet mode

Martin Flöser mgraesslin at kde.org
Tue Jan 9 18:56:34 UTC 2018


Am 2018-01-09 13:27, schrieb Marco Martin:
> On Fri, Jan 5, 2018 at 6:21 PM, Martin Flöser <mgraesslin at kde.org> 
> wrote:
>> 
>> So I would do something like a small class
>> 
>> class TabletModeManager : public QObject, public InputEventSpy
>> {
>> };
>> 
> 
> I'm starting on this direction now, another thing: libinput has the
> event for the mode change, but is there a way to query the initial
> state to know whether kwi was started in tablet or desktop mode?

 From documentation [1]:

"The default state of a switch is LIBINPUT_SWITCH_STATE_OFF and no event 
is sent to confirm a switch in the off position. If a switch is 
logically on during initialization, libinput sends an event of type 
LIBINPUT_EVENT_SWITCH_TOGGLE with a state LIBINPUT_SWITCH_STATE_ON."

Cheers
Martin

[1] 
https://wayland.freedesktop.org/libinput/doc/latest/group__device.html#ga63ae35419b521252bc5633912d032beb


More information about the Plasma-devel mailing list