<div dir="ltr"><div class="gmail_default" style="font-size:large">​​</div><div class="gmail_default">Hmmm, after using udev_device_has_tag(udev_device, "ID_INPUT_TOUCHPAD"),</div><div class="gmail_default">I'm getting linking errors. Quick google of this leads to: libraries on the command line should be after the object files being compiled.</div><div class="gmail_default">Is this a bug?</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 5, 2017 at 7:20 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Sun, Feb 05, 2017 at 07:13:04PM -0500, Jiayi Zhao wrote:<br>
> How would ID_INPUT_TOUCHPAD work?<br>
> I have something like udev_device_has_tag(udev_<wbr>device, ID_INPUT_TOUCHPAD)<br>
> Unfortunately, I'm not sure where this constant is declared and its unable<br>
> to find the tag. :/<br>
<br>
</span>it's a udev property name, so use it as a string, not a #define.<br>
value is either 1 or 0, so you do need to check for validity.<br>
<br>
Cheers,<br>
   Peter<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
> On Jan 29, 2017 4:42 PM, "Peter Hutterer" <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>> wrote:<br>
><br>
> > On Fri, Jan 27, 2017 at 09:46:49PM -0500, Jiayi Zhao wrote:<br>
> > > [libinput]<br>
> > > natural_scroll=true<br>
> > ><br>
> > > CHANGES:<br>
> > >  - libinput_device_config_scroll_<wbr>has_natural_scroll() is no longer<br>
> > compared to != 0<br>
> > >  - added configuration option to weston.ini man page<br>
> > ><br>
> > > Signed-off-by: Jiayi Zhao <<a href="mailto:jeff.no.zhao@gmail.com">jeff.no.zhao@gmail.com</a>><br>
> > > ---<br>
> > >  compositor/main.c  | 13 +++++++++++++<br>
> > >  man/weston.ini.man |  3 +++<br>
> > >  <a href="http://weston.ini.in" rel="noreferrer" target="_blank">weston.ini.in</a>      |  1 +<br>
> > >  3 files changed, 17 insertions(+)<br>
> > ><br>
> > > diff --git a/compositor/main.c b/compositor/main.c<br>
> > > index 4bd6e68..84bb8dd 100644<br>
> > > --- a/compositor/main.c<br>
> > > +++ b/compositor/main.c<br>
> > > @@ -1133,6 +1133,8 @@ configure_input_device(struct weston_compositor<br>
> > *compositor,<br>
> > >       struct weston_config *config = wet_get_config(compositor);<br>
> > >       int enable_tap;<br>
> > >       int enable_tap_default;<br>
> > > +     int natural_scroll;<br>
> > > +     int natural_scroll_default;<br>
> > ><br>
> > >       s = weston_config_get_section(<wbr>config,<br>
> > >                                     "libinput", NULL, NULL);<br>
> > > @@ -1147,6 +1149,17 @@ configure_input_device(struct weston_compositor<br>
> > *compositor,<br>
> > >               libinput_device_config_tap_<wbr>set_enabled(device,<br>
> > >                                                      enable_tap);<br>
> > >       }<br>
> > > +<br>
> > > +     if (libinput_device_config_<wbr>scroll_has_natural_scroll(<wbr>device)) {<br>
> > > +             natural_scroll_default =<br>
> > > +                     libinput_device_config_scroll_<wbr>get_default_natural_<br>
> > scroll_enabled(<br>
> > > +                             device);<br>
> > > +             weston_config_section_get_<wbr>bool(s, "natural_scroll",<br>
> > > +                                             &natural_scroll,<br>
> > > +                                             natural_scroll_default);<br>
> > > +             libinput_device_config_scroll_<wbr>set_natural_scroll_<br>
> > enabled(device,<br>
> > > +                                                     natural_scroll);<br>
> > > +     }<br>
> ><br>
> > libinput exposes natural scrolling on mice as well and with this code<br>
> > you're enabling it on any device that has the option. so your mouse<br>
> > wheels will be upside down too when you enable this. That's probably not<br>
> > what you intended, but if so, prepare for angry emails :)<br>
> ><br>
> > there are two options to work around this:<br>
> > * check the udev device for ID_INPUT_TOUCHPAD<br>
> > * assume anything that has tapping is a touchpad<br>
> ><br>
> > Cheers,<br>
> >    Peter<br>
> ><br>
> > >  }<br>
> > ><br>
> > >  static void<br>
> > > diff --git a/man/weston.ini.man b/man/weston.ini.man<br>
> > > index 2edb085..62e0f92 100644<br>
> > > --- a/man/weston.ini.man<br>
> > > +++ b/man/weston.ini.man<br>
> > > @@ -187,6 +187,9 @@ Available configuration are:<br>
> > >  .TP 7<br>
> > >  .BI "enable_tap=" true<br>
> > >  enables tap to click on touchpad devices<br>
> > > +.TP 7<br>
> > > +.BI "natural_scroll=" true<br>
> > > +enables natural scrolling on touchpad devices<br>
> > >  .RS<br>
> > >  .PP<br>
> > ><br>
> > > diff --git a/<a href="http://weston.ini.in" rel="noreferrer" target="_blank">weston.ini.in</a> b/<a href="http://weston.ini.in" rel="noreferrer" target="_blank">weston.ini.in</a><br>
> > > index 257c4ec..f957ec6 100644<br>
> > > --- a/<a href="http://weston.ini.in" rel="noreferrer" target="_blank">weston.ini.in</a><br>
> > > +++ b/<a href="http://weston.ini.in" rel="noreferrer" target="_blank">weston.ini.in</a><br>
> > > @@ -61,6 +61,7 @@ path=@libexecdir@/weston-<wbr>keyboard<br>
> > ><br>
> > >  #[libinput]<br>
> > >  #enable_tap=true<br>
> > > +#natural_scroll=false<br>
> > ><br>
> > >  #[touchpad]<br>
> > >  #constant_accel_factor = 50<br>
> > > --<br>
> > > 2.10.2<br>
> > ><br>
> > > ______________________________<wbr>_________________<br>
> > > wayland-devel mailing list<br>
> > > <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.<wbr>freedesktop.org</a><br>
> > > <a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/wayland-devel</a><br>
> > ><br>
> ><br>
</div></div></blockquote></div><br></div></div>