diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-10-18 05:10:35 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-10-18 05:10:35 +0400 |
commit | 5b31d545dfae5ee3fd5f4a5d0e9497a1c7c2a86b (patch) | |
tree | 7494146547b5ca59c5a206ab59daa90d60a85a20 /intern/ghost/intern/GHOST_SystemWin32.cpp | |
parent | 9e7142e2b0d2e8cdc78ca45162584b6da892931e (diff) | |
parent | 8b7e01b0bbdada3070c52f980a5f610d4a6c98c8 (diff) |
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r31926:32200
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 33c7a7f15a2..dceecb53dd2 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -287,17 +287,6 @@ GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) const { - /* - GetKeyState and GetAsyncKeyState only work with Win95, Win98, NT4, - Terminal Server and Windows 2000. - But on WinME it always returns zero. These two functions are simply - skipped by Millenium Edition! - - Official explanation from Microsoft: - Intentionally disabled. - It didn't work all that well on some newer hardware, and worked less - well with the passage of time, so it was fully disabled in ME. - */ if (m_separateLeftRight && m_separateLeftRightInitialized) { bool down = HIBYTE(::GetKeyState(VK_LSHIFT)) != 0; keys.set(GHOST_kModifierKeyLeftShift, down); @@ -311,6 +300,12 @@ GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) cons keys.set(GHOST_kModifierKeyLeftControl, down); down = HIBYTE(::GetKeyState(VK_RCONTROL)) != 0; keys.set(GHOST_kModifierKeyRightControl, down); + bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0; + bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0; + if(lwindown || rwindown) + keys.set(GHOST_kModifierKeyCommand, true); + else + keys.set(GHOST_kModifierKeyCommand, false); } else { bool down = HIBYTE(::GetKeyState(VK_SHIFT)) != 0; @@ -322,6 +317,12 @@ GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) cons down = HIBYTE(::GetKeyState(VK_CONTROL)) != 0; keys.set(GHOST_kModifierKeyLeftControl, down); keys.set(GHOST_kModifierKeyRightControl, down); + bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0; + bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0; + if(lwindown || rwindown) + keys.set(GHOST_kModifierKeyCommand, true); + else + keys.set(GHOST_kModifierKeyCommand, false); } return GHOST_kSuccess; } @@ -376,8 +377,8 @@ GHOST_TSuccess GHOST_SystemWin32::init() wc.cbClsExtra= 0; wc.cbWndExtra= 0; wc.hInstance= ::GetModuleHandle(0); - wc.hIcon = ::LoadIcon(wc.hInstance, "APPICON"); - + wc.hIcon = ::LoadIcon(wc.hInstance, "APPICON"); + if (!wc.hIcon) { ::LoadIcon(NULL, IDI_APPLICATION); } @@ -670,6 +671,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, case VK_SHIFT: case VK_CONTROL: case VK_MENU: + case VK_LWIN: + case VK_RWIN: if (!system->m_separateLeftRightInitialized) { // Check whether this system supports separate left and right keys switch (wParam) { @@ -691,6 +694,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, (HIBYTE(::GetKeyState(VK_RMENU)) != 0) ? true : false; break; + case VK_LWIN: + case VK_RWIN: + system->m_separateLeftRight = true; + break; } system->m_separateLeftRightInitialized = true; } @@ -714,6 +721,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, case VK_SHIFT: case VK_CONTROL: case VK_MENU: + case VK_LWIN: + case VK_RWIN: system->processModifierKeys(window); // Bypass call to DefWindowProc return 0; |