Mini: Fix right button forwarding

This commit is contained in:
Stenzek 2025-03-23 23:39:26 +10:00
parent 2cb6ce635f
commit 104c82c2c3
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions
src/duckstation-mini

View File

@ -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);
});