From 7ca5e14938c8607a2d5dc7ff479e76004bfe454b Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 30 Jul 2021 07:01:37 -0400 Subject: [PATCH] [client] imgui: implement mouse wheel motion support The display server should call app_handleWheelMotion as necessary. --- client/include/app.h | 1 + client/src/app.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/client/include/app.h b/client/include/app.h index f9898d59..68089df0 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -56,6 +56,7 @@ void app_resyncMouseBasic(void); void app_handleButtonPress(int button); void app_handleButtonRelease(int button); +void app_handleWheelMotion(double motion); void app_handleKeyPress(int scancode); void app_handleKeyRelease(int scancode); void app_handleEnterEvent(bool entered); diff --git a/client/src/app.c b/client/src/app.c index c6be9845..aa9d9e62 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -270,6 +270,12 @@ void app_handleButtonRelease(int button) DEBUG_ERROR("app_handleButtonRelease: failed to send message"); } +void app_handleWheelMotion(double motion) +{ + if (g_state.overlayInput) + g_state.io->MouseWheel -= motion; +} + void app_handleKeyPress(int sc) { if (sc == g_params.escapeKey && !g_state.escapeActive)