|
|
@ -39,6 +39,7 @@ void handle_pointer_motion(struct libinput_event *event,
|
|
|
|
wlr_event.unaccel_dx = libinput_event_pointer_get_dx_unaccelerated(pevent);
|
|
|
|
wlr_event.unaccel_dx = libinput_event_pointer_get_dx_unaccelerated(pevent);
|
|
|
|
wlr_event.unaccel_dy = libinput_event_pointer_get_dy_unaccelerated(pevent);
|
|
|
|
wlr_event.unaccel_dy = libinput_event_pointer_get_dy_unaccelerated(pevent);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion, &wlr_event);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion, &wlr_event);
|
|
|
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.frame, wlr_dev->pointer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handle_pointer_motion_abs(struct libinput_event *event,
|
|
|
|
void handle_pointer_motion_abs(struct libinput_event *event,
|
|
|
@ -58,6 +59,7 @@ void handle_pointer_motion_abs(struct libinput_event *event,
|
|
|
|
wlr_event.x = libinput_event_pointer_get_absolute_x_transformed(pevent, 1);
|
|
|
|
wlr_event.x = libinput_event_pointer_get_absolute_x_transformed(pevent, 1);
|
|
|
|
wlr_event.y = libinput_event_pointer_get_absolute_y_transformed(pevent, 1);
|
|
|
|
wlr_event.y = libinput_event_pointer_get_absolute_y_transformed(pevent, 1);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion_absolute, &wlr_event);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion_absolute, &wlr_event);
|
|
|
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.frame, wlr_dev->pointer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handle_pointer_button(struct libinput_event *event,
|
|
|
|
void handle_pointer_button(struct libinput_event *event,
|
|
|
@ -84,6 +86,7 @@ void handle_pointer_button(struct libinput_event *event,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.button, &wlr_event);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.button, &wlr_event);
|
|
|
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.frame, wlr_dev->pointer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handle_pointer_axis(struct libinput_event *event,
|
|
|
|
void handle_pointer_axis(struct libinput_event *event,
|
|
|
@ -114,13 +117,13 @@ void handle_pointer_axis(struct libinput_event *event,
|
|
|
|
wlr_event.source = WLR_AXIS_SOURCE_WHEEL_TILT;
|
|
|
|
wlr_event.source = WLR_AXIS_SOURCE_WHEEL_TILT;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
enum libinput_pointer_axis axies[] = {
|
|
|
|
const enum libinput_pointer_axis axes[] = {
|
|
|
|
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
|
|
|
|
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
|
|
|
|
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL,
|
|
|
|
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
for (size_t i = 0; i < sizeof(axies) / sizeof(axies[0]); ++i) {
|
|
|
|
for (size_t i = 0; i < sizeof(axes) / sizeof(axes[0]); ++i) {
|
|
|
|
if (libinput_event_pointer_has_axis(pevent, axies[i])) {
|
|
|
|
if (libinput_event_pointer_has_axis(pevent, axes[i])) {
|
|
|
|
switch (axies[i]) {
|
|
|
|
switch (axes[i]) {
|
|
|
|
case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
|
|
|
|
case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
|
|
|
|
wlr_event.orientation = WLR_AXIS_ORIENTATION_VERTICAL;
|
|
|
|
wlr_event.orientation = WLR_AXIS_ORIENTATION_VERTICAL;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -129,10 +132,11 @@ void handle_pointer_axis(struct libinput_event *event,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wlr_event.delta =
|
|
|
|
wlr_event.delta =
|
|
|
|
libinput_event_pointer_get_axis_value(pevent, axies[i]);
|
|
|
|
libinput_event_pointer_get_axis_value(pevent, axes[i]);
|
|
|
|
wlr_event.delta_discrete =
|
|
|
|
wlr_event.delta_discrete =
|
|
|
|
libinput_event_pointer_get_axis_value_discrete(pevent, axies[i]);
|
|
|
|
libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.axis, &wlr_event);
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.axis, &wlr_event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.frame, wlr_dev->pointer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|