[libinput] Support toggleTouchpad
ClosedPublic

Authored by graesslin on May 6 2016, 10:34 AM.

Details

Summary

The LibInput::Device provides a way to enable/disable the device.
This is used by the Connection to toggle all touchpad devices on/off
when the touchpad key is pressed. This is a hard coded key and not
mapped to a global shortcut (maybe it should?).

Detecting what is a touchpad is unfortunately not tivial. The code
uses the following approach:

  • it's a pointer
  • it's not also a keyboard or touch screen
  • it's at least one of the following:
    • supports multiple tap fingers
    • supports disable while typing
    • supports disable on external mouse

If the code finds a touchpad and changes it's state successfully,
it triggers the touchpadEnabledChanged on Plasma's osdService.

Test Plan

Tested on notebook with toggle touchpad button

Diff Detail

Repository
R108 KWin
Branch
toggle-touchpad
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin updated this revision to Diff 3661.May 6 2016, 10:34 AM
graesslin retitled this revision from to [libinput] Support toggleTouchpad.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 6 2016, 10:34 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 3667.May 6 2016, 11:44 AM

Now with global shortcut stealing and support also for on/off in addition to just toggle

graesslin updated this revision to Diff 3720.May 9 2016, 7:27 AM

Only emit changed signal if value changed

broulik accepted this revision.May 9 2016, 2:21 PM
broulik added a reviewer: broulik.
broulik added a subscriber: broulik.

Next step would be supporting the "automatically disable when plugging in an external mouse" option

This revision is now accepted and ready to land.May 9 2016, 2:21 PM

Next step would be supporting the "automatically disable when plugging in an external mouse" option

No, the next step is making the kcm work. If we cannot configure it doesn't make sense to support the options.

This revision was automatically updated to reflect the committed changes.