X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/df707c27b3837ef17a0ede057e900638555525ce..18caa1e963269d02499b327bb4e7cc2ac48fd67e:/src/msw/window.cpp?ds=sidebyside diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 06e820fe43..53eefe26ed 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -6084,6 +6084,9 @@ WXWORD wxCharCodeWXToMSW(int wxk, bool *isVirtual) break; default: + // no VkKeyScan() under CE unfortunately, we need to test how does + // it handle OEM keys +#ifndef __WXWINCE__ // check to see if its one of the OEM key codes. BYTE vks = LOBYTE(VkKeyScan(wxk)); if ( vks != 0xff ) @@ -6091,6 +6094,7 @@ WXWORD wxCharCodeWXToMSW(int wxk, bool *isVirtual) vk = vks; } else +#endif // !__WXWINCE__ { if ( isVirtual ) *isVirtual = false; @@ -6101,22 +6105,23 @@ 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) + // SM_SWAPBUTTON is not available under CE, so don't swap buttons there +#ifdef SM_SWAPBUTTON + if ( vk == VK_LBUTTON || vk == VK_RBUTTON ) { - case VK_LBUTTON: - if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_RBUTTON; - break; - case VK_RBUTTON: - if (GetSystemMetrics(SM_SWAPBUTTON)) vk = VK_LBUTTON; - break; + if ( ::GetSystemMetrics(SM_SWAPBUTTON) ) + { + if ( vk == VK_LBUTTON ) + vk = VK_RBUTTON; + else // vk == VK_RBUTTON + vk = VK_LBUTTON; + } } +#endif // SM_SWAPBUTTON + // 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