From 3345be133ad382c302c12219f5c13f98805ca701 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 30 Dec 2021 00:05:30 +0100 Subject: [PATCH] Add relative mouse motion in event This will allow the mouse processor to handle relative motion easily. --- app/src/input_events.h | 2 ++ app/src/input_manager.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/input_events.h b/app/src/input_events.h index b40995e6..b56f3a23 100644 --- a/app/src/input_events.h +++ b/app/src/input_events.h @@ -365,6 +365,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 }; diff --git a/app/src/input_manager.c b/app/src/input_manager.c index a1ecc6c6..ad65c212 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -654,6 +654,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),