From dec7875a6e23212021e4d9080330a42832dfe02a Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 15 Jun 2021 01:40:19 +0000
Subject: [PATCH] update SDL soruce to 2.0.14
---
source/src/video/windows/SDL_windowsmouse.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/source/src/video/windows/SDL_windowsmouse.c b/source/src/video/windows/SDL_windowsmouse.c
index 9fdb911..826cbb2 100644
--- a/source/src/video/windows/SDL_windowsmouse.c
+++ b/source/src/video/windows/SDL_windowsmouse.c
@@ -22,7 +22,6 @@
#if SDL_VIDEO_DRIVER_WINDOWS
-#include "SDL_assert.h"
#include "SDL_windowsvideo.h"
#include "../../events/SDL_mouse_c.h"
@@ -276,12 +275,14 @@
{
Uint32 retval = 0;
POINT pt = { 0, 0 };
+ SDL_bool swapButtons = GetSystemMetrics(SM_SWAPBUTTON) != 0;
+
GetCursorPos(&pt);
*x = (int) pt.x;
*y = (int) pt.y;
- retval |= GetAsyncKeyState(VK_LBUTTON) & 0x8000 ? SDL_BUTTON_LMASK : 0;
- retval |= GetAsyncKeyState(VK_RBUTTON) & 0x8000 ? SDL_BUTTON_RMASK : 0;
+ retval |= GetAsyncKeyState(!swapButtons ? VK_LBUTTON : VK_RBUTTON) & 0x8000 ? SDL_BUTTON_LMASK : 0;
+ retval |= GetAsyncKeyState(!swapButtons ? VK_RBUTTON : VK_LBUTTON) & 0x8000 ? SDL_BUTTON_RMASK : 0;
retval |= GetAsyncKeyState(VK_MBUTTON) & 0x8000 ? SDL_BUTTON_MMASK : 0;
retval |= GetAsyncKeyState(VK_XBUTTON1) & 0x8000 ? SDL_BUTTON_X1MASK : 0;
retval |= GetAsyncKeyState(VK_XBUTTON2) & 0x8000 ? SDL_BUTTON_X2MASK : 0;
--
Gitblit v1.9.3