[PATCH libinput] evdev: add quirk for the HP85810 touchpad

Peter Hutterer peter.hutterer at who-t.net
Thu Sep 1 00:50:58 UTC 2016


On Thu, Sep 01, 2016 at 09:28:48AM +1000, Peter Hutterer wrote:
> On Wed, Aug 31, 2016 at 03:41:57PM +0200, Daniel Martin wrote:
> > On 31 August 2016 at 02:27, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > > The touchpad's says it can do two- and three-finger detection but it never
> > > sends events for it. Disable them so we treat it as pure single-finger
> > > touchpad.
> > >
> > > https://bugzilla.redhat.com/show_bug.cgi?id=1351285
> > >
> > > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > > ---
> > >  src/evdev.c                        | 9 +++++++++
> > >  src/evdev.h                        | 1 +
> > >  udev/90-libinput-model-quirks.hwdb | 7 +++++++
> > >  3 files changed, 17 insertions(+)
> > >
> > > diff --git a/src/evdev.c b/src/evdev.c
> > > index 4ec74a5..9154e96 100644
> > > --- a/src/evdev.c
> > > +++ b/src/evdev.c
> > > @@ -1954,6 +1954,7 @@ evdev_read_model_flags(struct evdev_device *device)
> > >                 MODEL(DELL_TOUCHPAD),
> > >                 MODEL(TRACKBALL),
> > >                 MODEL(APPLE_MAGICMOUSE),
> > > +               MODEL(HP8510_TOUCHPAD),
> > >  #undef MODEL
> > >                 { "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
> > >                 { NULL, EVDEV_MODEL_DEFAULT },
> > > @@ -2521,6 +2522,14 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
> > >          */
> > >         if (device->model_flags & EVDEV_MODEL_APPLE_MAGICMOUSE)
> > >                 libevdev_disable_event_type(device->evdev, EV_ABS);
> > > +
> > > +       /* Claims to have double/tripletap but doesn't actually send it
> > > +        * https://bugzilla.redhat.com/show_bug.cgi?id=1351285
> > > +        */
> > > +       if (device->model_flags & EVDEV_MODEL_HP8510_TOUCHPAD) {
> > > +               libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_DOUBLETAP);
> > > +               libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_TRIPLETAP);
> > > +       }
> > >  }
> > >
> > >  struct evdev_device *
> > > diff --git a/src/evdev.h b/src/evdev.h
> > > index 9564e77..10b0e58 100644
> > > --- a/src/evdev.h
> > > +++ b/src/evdev.h
> > > @@ -118,6 +118,7 @@ enum evdev_device_model {
> > >         EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
> > >         EVDEV_MODEL_TRACKBALL = (1 << 19),
> > >         EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
> > > +       EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21),
> > >  };
> > 
> > How about using a more generic name, in case such a touchpad is/will
> > be built into another device?
> 
> this is an internal name only so we can change it when needed. for now I'd
> like to keep it as specific as possible.

more reasoning here just for the archives:
the tags are intended to be descriptive of the hardware and not the
behaviour. the behaviour is decided within libinput and may change at any
time. But they are udev properties so we can't make them fully private.

Because the tags are descriptive only it's (hopefully) less likely
that users will abuse them as configuration entities. e.g. applying the
"HP 8510" tag to a Lenovo Thinkpad *should* feel wrong to the user :)

Cheers,
   Peter



More information about the wayland-devel mailing list