[RFC] libinput configuration interface

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 30 17:05:29 PST 2014


I've been thinking about how to add a device configuration interface to
libinput, and after getting feedback from Jonas and Benjamin, here's a
proposal (no code yet).

First, I think the configuration should be feature-specific, not device
specific, so it is independent of a classification or capabilities of a
device. To the user it doesn't matter if we classify something as touchpad
or as mouse, if middle mouse button emulation works that's the only thing
that counts. At least for configuration purposes, this also avoids the
difficult task of classifying a device correctly. Those pesky HW
manufacturers do have a habit of coming up with devices that elude
previously agreed-on classification schemes, e.g. mice with touchpads on
them.

Aside from setting an item, there should be calls to get the current value,
and a call to reset to the built-in defaults. And, since we're
feature-based, a call to check if the config item is possible for a device.
Which leads us the the following quartet for each item:

    int libinput_device_config_set_foo(device, value);
    int libinput_device_config_get_foo(device, &value);
    int libinput_device_config_reset_foo(device);
    bool libinput_device_config_has_foo(device);

And the actual configuration items I've come up with so far:
* {set|get|reset|has}_tap_single_finger_button
* tap_double_finger_button
* tap_triple_finger_button
* click_finger_single
* click_finger_double
* click_finger_triple
* twofinger_scroll_vertical
* twofinger_scroll_horizonal
* edge_scroll_vertical
* edge_scroll_horizontal
* disable_while_typing
* disable_touch (while pen is in use)
  these two could be merged into "disable while linked device is in use"
* softbutton_left
* softbutton_middle
* softbutton_right
* emulate_middle_button
* button_mapping
* emulate_wheel
* rotation
* palm_detection 
* mode (relative/absolute)
* valid_area
  This is needed on tablets that have a different ratio than the monitor.
  Mapping them to the monitor results in uneven x/y movements, so the
  easiest approach here is to cut a portion of the tablet off to match the
  ratio.
* stylus_button_behaviour(some enum)
  Some tablets don't report proximity, the only way to get a right-button
  click is to hold the right button down and then tip with the stylus.

Note that the above is not a 1:1 API mapping, e.g. tapping configuration
could be an API taking nfingers as argument as opposed to 3 different calls. 
Likewise, they can take more than one value argument, e.g. middle button
emulation could take a boolean to enable it, and a timeout.

This list excludes options we currently have in the X drivers to adjust for
hw-specific quirks. Such as defining which pressure makes up a tap, etc. I
really hope this is something we can work out based on the device.

It also excludes configurations that I'd really like to hide away if
possible. For example, on the new T440-style touchpads the top part of it is
a set of buttons for the trackstick. There's nothing to be configured about
this, it should just work.

Comments? Does this sound sane enough? Anything important I've missed?

Cheers,
  Peter


More information about the wayland-devel mailing list