mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 18:40:05 +01:00
tablet: Include axes with all events
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
7fbb08e0ca
commit
521bd2f112
4 changed files with 26 additions and 9 deletions
|
|
@ -315,6 +315,7 @@ tablet_notify_button_mask(struct tablet_dispatch *tablet,
|
|||
tablet_notify_button(base,
|
||||
time,
|
||||
tool,
|
||||
tablet->axes,
|
||||
num_button + button_base - 1,
|
||||
state);
|
||||
}
|
||||
|
|
@ -391,7 +392,10 @@ tablet_flush(struct tablet_dispatch *tablet,
|
|||
tablet->button_state.stylus_buttons = 0;
|
||||
tablet_set_status(tablet, TABLET_BUTTONS_RELEASED);
|
||||
} else if (tablet_has_status(tablet, TABLET_TOOL_ENTERING_PROXIMITY)) {
|
||||
tablet_notify_proximity_in(&device->base, time, tool);
|
||||
tablet_notify_proximity_in(&device->base,
|
||||
time,
|
||||
tool,
|
||||
tablet->axes);
|
||||
tablet_unset_status(tablet, TABLET_TOOL_ENTERING_PROXIMITY);
|
||||
}
|
||||
|
||||
|
|
@ -420,7 +424,10 @@ tablet_flush(struct tablet_dispatch *tablet,
|
|||
}
|
||||
|
||||
if (tablet_has_status(tablet, TABLET_TOOL_LEAVING_PROXIMITY)) {
|
||||
tablet_notify_proximity_out(&device->base, time, tool);
|
||||
tablet_notify_proximity_out(&device->base,
|
||||
time,
|
||||
tool,
|
||||
tablet->axes);
|
||||
tablet_set_status(tablet, TABLET_TOOL_OUT_OF_PROXIMITY);
|
||||
tablet_unset_status(tablet, TABLET_TOOL_LEAVING_PROXIMITY);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,17 +221,20 @@ tablet_notify_axis(struct libinput_device *device,
|
|||
void
|
||||
tablet_notify_proximity_in(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
struct libinput_tool *tool);
|
||||
struct libinput_tool *tool,
|
||||
double *axes);
|
||||
|
||||
void
|
||||
tablet_notify_proximity_out(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
struct libinput_tool *tool);
|
||||
struct libinput_tool *tool,
|
||||
double *axes);
|
||||
|
||||
void
|
||||
tablet_notify_button(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
struct libinput_tool *tool,
|
||||
double *axes,
|
||||
int32_t button,
|
||||
enum libinput_button_state state);
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1258,7 +1258,8 @@ tablet_notify_axis(struct libinput_device *device,
|
|||
void
|
||||
tablet_notify_proximity_in(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
struct libinput_tool *tool)
|
||||
struct libinput_tool *tool,
|
||||
double *axes)
|
||||
{
|
||||
struct libinput_event_tablet *proximity_in_event;
|
||||
|
||||
|
|
@ -1270,6 +1271,9 @@ tablet_notify_proximity_in(struct libinput_device *device,
|
|||
.time = time,
|
||||
.tool = tool,
|
||||
};
|
||||
memcpy(proximity_in_event->axes,
|
||||
axes,
|
||||
sizeof(proximity_in_event->axes));
|
||||
|
||||
post_device_event(device,
|
||||
LIBINPUT_EVENT_TABLET_PROXIMITY_IN,
|
||||
|
|
@ -1279,7 +1283,8 @@ tablet_notify_proximity_in(struct libinput_device *device,
|
|||
void
|
||||
tablet_notify_proximity_out(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
struct libinput_tool *tool)
|
||||
struct libinput_tool *tool,
|
||||
double *axes)
|
||||
{
|
||||
struct libinput_event_tablet *proximity_out_update_event;
|
||||
|
||||
|
|
@ -1291,6 +1296,9 @@ tablet_notify_proximity_out(struct libinput_device *device,
|
|||
.time = time,
|
||||
.tool = tool,
|
||||
};
|
||||
memcpy(proximity_out_update_event->axes,
|
||||
axes,
|
||||
sizeof(proximity_out_update_event->axes));
|
||||
|
||||
post_device_event(device,
|
||||
LIBINPUT_EVENT_TABLET_PROXIMITY_OUT,
|
||||
|
|
@ -1301,6 +1309,7 @@ void
|
|||
tablet_notify_button(struct libinput_device *device,
|
||||
uint32_t time,
|
||||
struct libinput_tool *tool,
|
||||
double *axes,
|
||||
int32_t button,
|
||||
enum libinput_button_state state)
|
||||
{
|
||||
|
|
@ -1322,6 +1331,7 @@ tablet_notify_button(struct libinput_device *device,
|
|||
.state = state,
|
||||
.seat_button_count = seat_button_count,
|
||||
};
|
||||
memcpy(button_event->axes, axes, sizeof(button_event->axes));
|
||||
|
||||
post_device_event(device,
|
||||
LIBINPUT_EVENT_TABLET_BUTTON,
|
||||
|
|
|
|||
|
|
@ -876,9 +876,6 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
|
|||
* that indicates the tilt vertical or horizontal tilt of the tool
|
||||
* respectively
|
||||
*
|
||||
* For tablet events that are not of type @ref LIBINPUT_EVENT_TABLET_AXIS, this
|
||||
* function returns 0.
|
||||
*
|
||||
* @param event The libinput tablet event
|
||||
* @param axis The axis to retrieve the value of
|
||||
* @return The current value of the the axis
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue