Pass LibInput::Device* through the event handlers
ClosedPublic

Authored by graesslin on May 24 2016, 9:04 AM.

Details

Summary

The signals emitted by LibInput::Connection carry the Device for which
the input event was received. This Device is passed to the input handlers.

Custom event classes are added which extend QMouseEvent, QKeyEvent and
QWheelEvent respectively and expose the Device. The Device is only passed
around as a forward declared pointer, so even if compiled without libinput
support, it should still compile.

Event handlers which need to get access to the Device can now just cast
the event pointer to the custom class and access it. This can be used in
future to handle device specific key codes, etc.

As we don't have a proper event classes for touch events the event
handlers do not yet have access to the Device. Here the internal API
needs to be adjusted in future.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 3956.May 24 2016, 9:04 AM
graesslin retitled this revision from to Pass LibInput::Device* through the event handlers.
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 24 2016, 9:04 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sebas accepted this revision.May 30 2016, 12:26 PM
sebas added a reviewer: sebas.
sebas added a subscriber: sebas.

nice work

pointer_input.cpp
198 ↗(On Diff #3956)

device is used here, though

This revision is now accepted and ready to land.May 30 2016, 12:26 PM
graesslin marked an inline comment as done.May 30 2016, 1:26 PM
This revision was automatically updated to reflect the committed changes.