From 04620b9f2ff5efb6d8901343157d3817b215f999 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Mon, 27 Aug 2012 10:33:36 +0200 Subject: [PATCH] sf::Mouse::isButtonPressed nows uses logical buttons --- src/SFML/Window/Win32/InputImpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SFML/Window/Win32/InputImpl.cpp b/src/SFML/Window/Win32/InputImpl.cpp index 66cbc59e..4dbd37fc 100644 --- a/src/SFML/Window/Win32/InputImpl.cpp +++ b/src/SFML/Window/Win32/InputImpl.cpp @@ -162,12 +162,12 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button) int vkey = 0; switch (button) { - default: vkey = 0; break; - case Mouse::Left: vkey = VK_LBUTTON; break; - case Mouse::Right: vkey = VK_RBUTTON; break; + case Mouse::Left: vkey = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON; break; + case Mouse::Right: vkey = GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON; break; case Mouse::Middle: vkey = VK_MBUTTON; break; case Mouse::XButton1: vkey = VK_XBUTTON1; break; case Mouse::XButton2: vkey = VK_XBUTTON2; break; + default: vkey = 0; break; } return (GetAsyncKeyState(vkey) & 0x8000) != 0;