|
|
|
@ -28,14 +28,14 @@ void handle_pointer_motion(struct libinput_event *event,
|
|
|
|
|
struct wlr_pointer *pointer) {
|
|
|
|
|
struct libinput_event_pointer *pevent =
|
|
|
|
|
libinput_event_get_pointer_event(event);
|
|
|
|
|
struct wlr_pointer_motion_event wlr_event = { 0 };
|
|
|
|
|
wlr_event.pointer = pointer;
|
|
|
|
|
wlr_event.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
|
|
|
|
wlr_event.delta_x = libinput_event_pointer_get_dx(pevent);
|
|
|
|
|
wlr_event.delta_y = libinput_event_pointer_get_dy(pevent);
|
|
|
|
|
wlr_event.unaccel_dx = libinput_event_pointer_get_dx_unaccelerated(pevent);
|
|
|
|
|
wlr_event.unaccel_dy = libinput_event_pointer_get_dy_unaccelerated(pevent);
|
|
|
|
|
struct wlr_pointer_motion_event wlr_event = {
|
|
|
|
|
.pointer = pointer,
|
|
|
|
|
.time_msec = usec_to_msec(libinput_event_pointer_get_time_usec(pevent)),
|
|
|
|
|
.delta_x = libinput_event_pointer_get_dx(pevent),
|
|
|
|
|
.delta_y = libinput_event_pointer_get_dy(pevent),
|
|
|
|
|
.unaccel_dx = libinput_event_pointer_get_dx_unaccelerated(pevent),
|
|
|
|
|
.unaccel_dy = libinput_event_pointer_get_dy_unaccelerated(pevent),
|
|
|
|
|
};
|
|
|
|
|
wl_signal_emit_mutable(&pointer->events.motion, &wlr_event);
|
|
|
|
|
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
|
|
|
|
}
|
|
|
|
@ -44,12 +44,12 @@ void handle_pointer_motion_abs(struct libinput_event *event,
|
|
|
|
|
struct wlr_pointer *pointer) {
|
|
|
|
|
struct libinput_event_pointer *pevent =
|
|
|
|
|
libinput_event_get_pointer_event(event);
|
|
|
|
|
struct wlr_pointer_motion_absolute_event wlr_event = { 0 };
|
|
|
|
|
wlr_event.pointer = pointer;
|
|
|
|
|
wlr_event.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
|
|
|
|
wlr_event.x = libinput_event_pointer_get_absolute_x_transformed(pevent, 1);
|
|
|
|
|
wlr_event.y = libinput_event_pointer_get_absolute_y_transformed(pevent, 1);
|
|
|
|
|
struct wlr_pointer_motion_absolute_event wlr_event = {
|
|
|
|
|
.pointer = pointer,
|
|
|
|
|
.time_msec = usec_to_msec(libinput_event_pointer_get_time_usec(pevent)),
|
|
|
|
|
.x = libinput_event_pointer_get_absolute_x_transformed(pevent, 1),
|
|
|
|
|
.y = libinput_event_pointer_get_absolute_y_transformed(pevent, 1),
|
|
|
|
|
};
|
|
|
|
|
wl_signal_emit_mutable(&pointer->events.motion_absolute, &wlr_event);
|
|
|
|
|
wl_signal_emit_mutable(&pointer->events.frame, pointer);
|
|
|
|
|
}
|
|
|
|
@ -58,11 +58,11 @@ void handle_pointer_button(struct libinput_event *event,
|
|
|
|
|
struct wlr_pointer *pointer) {
|
|
|
|
|
struct libinput_event_pointer *pevent =
|
|
|
|
|
libinput_event_get_pointer_event(event);
|
|
|
|
|
struct wlr_pointer_button_event wlr_event = { 0 };
|
|
|
|
|
wlr_event.pointer = pointer;
|
|
|
|
|
wlr_event.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
|
|
|
|
wlr_event.button = libinput_event_pointer_get_button(pevent);
|
|
|
|
|
struct wlr_pointer_button_event wlr_event = {
|
|
|
|
|
.pointer = pointer,
|
|
|
|
|
.time_msec = usec_to_msec(libinput_event_pointer_get_time_usec(pevent)),
|
|
|
|
|
.button = libinput_event_pointer_get_button(pevent),
|
|
|
|
|
};
|
|
|
|
|
// Ignore events which aren't a seat-wide state change. For instance, if
|
|
|
|
|
// the same button is pressed twice on the same seat, ignore the second
|
|
|
|
|
// press.
|
|
|
|
@ -89,10 +89,10 @@ void handle_pointer_axis(struct libinput_event *event,
|
|
|
|
|
struct wlr_pointer *pointer) {
|
|
|
|
|
struct libinput_event_pointer *pevent =
|
|
|
|
|
libinput_event_get_pointer_event(event);
|
|
|
|
|
struct wlr_pointer_axis_event wlr_event = { 0 };
|
|
|
|
|
wlr_event.pointer = pointer;
|
|
|
|
|
wlr_event.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
|
|
|
|
struct wlr_pointer_axis_event wlr_event = {
|
|
|
|
|
.pointer = pointer,
|
|
|
|
|
.time_msec = usec_to_msec(libinput_event_pointer_get_time_usec(pevent)),
|
|
|
|
|
};
|
|
|
|
|
switch (libinput_event_pointer_get_axis_source(pevent)) {
|
|
|
|
|
case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL:
|
|
|
|
|
wlr_event.source = WLR_AXIS_SOURCE_WHEEL;
|
|
|
|
@ -139,11 +139,11 @@ void handle_pointer_axis_value120(struct libinput_event *event,
|
|
|
|
|
struct wlr_pointer *pointer, enum wlr_axis_source source) {
|
|
|
|
|
struct libinput_event_pointer *pevent =
|
|
|
|
|
libinput_event_get_pointer_event(event);
|
|
|
|
|
struct wlr_pointer_axis_event wlr_event = { 0 };
|
|
|
|
|
wlr_event.pointer = pointer;
|
|
|
|
|
wlr_event.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
|
|
|
|
wlr_event.source = source;
|
|
|
|
|
struct wlr_pointer_axis_event wlr_event = {
|
|
|
|
|
.pointer = pointer,
|
|
|
|
|
.time_msec = usec_to_msec(libinput_event_pointer_get_time_usec(pevent)),
|
|
|
|
|
.source = source,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const enum libinput_pointer_axis axes[] = {
|
|
|
|
|
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
|
|
|
|
|