X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ff7282e135ce73ca6fc4fb4ef037ea2808401272..6d50049a5c4a04f10df683482b51e10c2d65ef84:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 0046539480..75167901ab 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -5769,13 +5769,26 @@ WXWORD wxCharCodeWXToMSW(int wxk, bool *isVirtual) return vk; } +#ifndef SM_SWAPBUTTON + #define SM_SWAPBUTTON 23 +#endif + // small helper for wxGetKeyState() and wxGetMouseState() static inline bool wxIsKeyDown(WXWORD vk) { + switch (vk) + { + case VK_LBUTTON: + if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_RBUTTON; + break; + case VK_RBUTTON: + if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_LBUTTON; + break; + } // the low order bit indicates whether the key was pressed since the last // call and the high order one indicates whether it is down right now and // we only want that one - return (::GetAsyncKeyState(vk) & (1<<15)) != 0; + return (GetAsyncKeyState(vk) & (1<<15)) != 0; } bool wxGetKeyState(wxKeyCode key) @@ -5795,7 +5808,7 @@ bool wxGetKeyState(wxKeyCode key) // low order bit means LED is highlighted and high order one means the // key is down; for compatibility with the other ports return true if // either one is set - return ::GetKeyState(vk) != 0; + return GetKeyState(vk) != 0; } else // normal key