[PATCH libinput 2/3] tablet: normalize the distance to 0..1

Peter Hutterer peter.hutterer at who-t.net
Mon Jun 23 18:36:14 PDT 2014


On Mon, Jun 23, 2014 at 01:08:42PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 06/23/2014 06:16 AM, Peter Hutterer wrote:
> > The actual data provided by current tablets is not anywhere close to accurate.
> > While it'd be nice to have this in mm, this is unlikely to happen anytime
> > soon. Use the same 0..1 normalized range as pressure has.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  src/evdev-tablet.c | 2 --
> >  src/libinput.h     | 4 ++--
> >  2 files changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
> > index 09bb454..9f19565 100644
> > --- a/src/evdev-tablet.c
> > +++ b/src/evdev-tablet.c
> > @@ -145,8 +145,6 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
> >  							      absinfo->value);
> >  			break;
> >  		case LIBINPUT_TABLET_AXIS_DISTANCE:
> > -			tablet->axes[a] = absinfo->value;
> > -			break;
> >  		case LIBINPUT_TABLET_AXIS_PRESSURE:
> >  			tablet->axes[a] = normalize_pressure(absinfo);
> 
> Shouldn't we rename normalize_pressure to something less pressure specific then ?
> 
> Other then that this patch-set looks good and is:
> 
> Reviewed-by: Hans de Goede <hdegoede at redhat.com>

renamed to normalize_pressure_or_dist(), thanks.

Cheers,
   Peter

> 
> >  			break;
> > diff --git a/src/libinput.h b/src/libinput.h
> > index ada6829..0a91456 100644
> > --- a/src/libinput.h
> > +++ b/src/libinput.h
> > @@ -866,8 +866,8 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
> >   *   tablet. Use libinput_event_tablet_get_x_transformed() and
> >   *   libinput_event_tablet_get_y_transformed() for transforming each
> >   *   respective axis value.
> > - * - @ref LIBINPUT_TABLET_AXIS_DISTANCE - Approximately how many millimeters
> > - *   away from the tablet's sensor the tool is
> > + * - @ref LIBINPUT_TABLET_AXIS_DISTANCE - The distance from the tablet's
> > + *   sensor, normalized from 0 to 1
> >   * - @ref LIBINPUT_TABLET_AXIS_PRESSURE - The current pressure being applied on
> >   *   the tool in use, normalized from 0 to 1
> >   * - @ref LIBINPUT_TABLET_AXIS_TILT_VERTICAL and @ref
> > 


More information about the wayland-devel mailing list