synaptics rework - multiple frontends
peter.hutterer at who-t.net
Tue May 22 22:31:07 PDT 2012
Jonas posted some touchpad support patches earlier this month and
there were some calls for a input handling module. I've hacked around for a
few days to get the synaptics driver ready for wayland.
This is not a wayland touchpad driver! It's the X11 driver, abstracted
enough that a wayland frontend _may_ be possible, if this is what we want.
Code is available here:
Of particularly interest is the new dummy synaptics driver:
That file is 150 lines long and all it does is print events to the log -
except that it has the same features as the X11 driver, twofinger scrolling,
etc. Shouldn't be too hard to imagine how a weston touchpad driver would
look like then. The basic approach is to fill a struct SynapticsFrontend
with callbacks for log messages, events, etc. and then call a few functions
to set up the driver. Events are handled by calling SynapticsReadInput()
whenever data is available on the fd, the driver will call the
button/motion/scrolll/touch event callbacks in return.
Changing defaults is simply done by changing bits in the SynapticsParamaters
A few things to note:
- this driver is simply the X driver untangled into an X-specific bit and
the core driver. So it doesn't have a good API (or even a nice clean one).
This is particularly visible with the VMask implementation that are just
the valuator_mask_* calls from the server. I suspect this will mutate into
a TouchRec implementation that talks ABS_MT_*
- the internal APIs are by no means finalised (and since they are
driver-internal anyway they don't ever have to be)
- following the git history is largely pointless. 142 commits, most of them
tiny and just shuffling code around. plus, I just hacked away instead
of properly grouping commits. just as a warning...
- the X driver still supports the legacy backends, but the core is now
evdev in, frontend hooks out.
More information about the wayland-devel