mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 19:10:53 +01:00
tablet: provide x/y by default in mm off the top/left corner
Given that tablets may not have the same x/y resolution, raw or normalized values are mostly meaningless and likely to be handled the wrong way. Providing x/y in mm is the only constant, meaningful value. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
bb1dd896ac
commit
797b4b4e5a
2 changed files with 8 additions and 5 deletions
|
|
@ -141,6 +141,9 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
|
|||
switch (a) {
|
||||
case LIBINPUT_TABLET_AXIS_X:
|
||||
case LIBINPUT_TABLET_AXIS_Y:
|
||||
tablet->axes[a] = evdev_convert_to_mm(absinfo,
|
||||
absinfo->value);
|
||||
break;
|
||||
case LIBINPUT_TABLET_AXIS_DISTANCE:
|
||||
tablet->axes[a] = absinfo->value;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -861,11 +861,11 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
|
|||
*
|
||||
* Return the axis value of a given axis for a tablet. The interpretation of the
|
||||
* value is dependent on the axis:
|
||||
* - @ref LIBINPUT_TABLET_AXIS_X and @ref LIBINPUT_TABLET_AXIS_Y - the raw X and
|
||||
* Y coordinates of the tablet tool. By default these are not transformed,
|
||||
* however libinput provides libinput_event_tablet_get_x_transformed() and
|
||||
* libinput_event_tablet_get_y_transformed() for transforming each respective
|
||||
* axis value.
|
||||
* - @ref LIBINPUT_TABLET_AXIS_X and @ref LIBINPUT_TABLET_AXIS_Y - the X and
|
||||
* Y coordinates of the tablet tool, in mm from the top left corner of the
|
||||
* 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_PRESSURE - The current pressure being applied on
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue