From 104c82c2c33cee96f60c20d269f1eee4c9589cf8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 23 Mar 2025 23:39:26 +1000 Subject: [PATCH] Mini: Fix right button forwarding --- src/duckstation-mini/mini_host.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/duckstation-mini/mini_host.cpp b/src/duckstation-mini/mini_host.cpp index a1c22c5f4..2cd4bc3dc 100644 --- a/src/duckstation-mini/mini_host.cpp +++ b/src/duckstation-mini/mini_host.cpp @@ -861,7 +861,9 @@ void MiniHost::ProcessSDLEvent(const SDL_Event* ev) { if (ev->button.button > 0) { - Host::RunOnCPUThread([button = ev->button.button - 1, pressed = (ev->type == SDL_EVENT_MOUSE_BUTTON_DOWN)]() { + // swap middle/right because sdl orders them differently + const u8 button = (ev->button.button == 3) ? 1 : ((ev->button.button == 2) ? 2 : (ev->button.button - 1)); + Host::RunOnCPUThread([button, pressed = (ev->type == SDL_EVENT_MOUSE_BUTTON_DOWN)]() { InputManager::InvokeEvents(InputManager::MakePointerButtonKey(0, button), pressed ? 1.0f : 0.0f, GenericInputBinding::Unknown); });