diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 09bb454f..e87d2522 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -104,7 +104,7 @@ tablet_update_tool(struct tablet_dispatch *tablet, } static inline double -normalize_pressure(const struct input_absinfo * absinfo) { +normalize_pressure_or_dist(const struct input_absinfo * absinfo) { double range = absinfo->maximum - absinfo->minimum + 1; double value = (absinfo->value + absinfo->minimum) / range; @@ -145,10 +145,8 @@ 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); + tablet->axes[a] = normalize_pressure_or_dist(absinfo); break; case LIBINPUT_TABLET_AXIS_TILT_VERTICAL: case LIBINPUT_TABLET_AXIS_TILT_HORIZONTAL: diff --git a/src/libinput.h b/src/libinput.h index ada68296..0a914569 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