Add relative mouse motion in event

This will allow the mouse processor to handle relative motion easily.
This commit is contained in:
Romain Vimont 2021-12-30 00:05:30 +01:00
parent 94b3328c2d
commit 5caace5818
2 changed files with 4 additions and 0 deletions

View file

@ -366,6 +366,8 @@ struct sc_mouse_scroll_event {
struct sc_mouse_motion_event {
struct sc_position position;
int32_t xrel;
int32_t yrel;
uint8_t buttons_state; // bitwise-OR of sc_mouse_button values
};

View file

@ -653,6 +653,8 @@ input_manager_process_mouse_motion(struct input_manager *im,
.point = screen_convert_window_to_frame_coords(im->screen,
event->x, event->y),
},
.xrel = event->xrel,
.yrel = event->yrel,
.buttons_state =
sc_mouse_buttons_state_from_sdl(event->state,
im->forward_all_clicks),