From eef2690adacd4df6f1b4b131ebc17fd4702ae3c5 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 2 Feb 2020 18:58:06 +0100 Subject: [PATCH] source/Platform/Win32/Win32Mouse.cpp: in isButtonDown() use SM_SWAPBUTTON to determine if buttons are swapped or not. --- source/Platform/Win32/Win32Mouse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Platform/Win32/Win32Mouse.cpp b/source/Platform/Win32/Win32Mouse.cpp index 4fa338d..3ad6a41 100644 --- a/source/Platform/Win32/Win32Mouse.cpp +++ b/source/Platform/Win32/Win32Mouse.cpp @@ -43,8 +43,8 @@ bool Win32Mouse::isButtonDown(Mouse::Button button) const int btn; switch(button) { - case Mouse::Left : btn = VK_LBUTTON; break; - case Mouse::Right : btn = VK_RBUTTON; break; + case Mouse::Left : btn = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON; break; + case Mouse::Right : btn = GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON; break; case Mouse::Middle : btn = VK_MBUTTON; break; case Mouse::Button1 : btn = VK_XBUTTON1; break; case Mouse::Button2 : btn = VK_XBUTTON2; break;