浏览代码

Examples: DirectX9/10/11: Added WM_SYSKEYDOWN / WM_SYSKEYUP handlers so e.g. VK_MENU can be read.

omar 8 年之前
父节点
当前提交
d6a9956781

+ 2 - 0
examples/directx10_example/imgui_impl_dx10.cpp

@@ -271,10 +271,12 @@ IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wPa
         io.MousePos.y = (signed short)(lParam >> 16);
         io.MousePos.y = (signed short)(lParam >> 16);
         return 0;
         return 0;
     case WM_KEYDOWN:
     case WM_KEYDOWN:
+    case WM_SYSKEYDOWN:
         if (wParam < 256)
         if (wParam < 256)
             io.KeysDown[wParam] = 1;
             io.KeysDown[wParam] = 1;
         return 0;
         return 0;
     case WM_KEYUP:
     case WM_KEYUP:
+    case WM_SYSKEYUP:
         if (wParam < 256)
         if (wParam < 256)
             io.KeysDown[wParam] = 0;
             io.KeysDown[wParam] = 0;
         return 0;
         return 0;

+ 2 - 0
examples/directx11_example/imgui_impl_dx11.cpp

@@ -278,10 +278,12 @@ IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wPa
         io.MousePos.y = (signed short)(lParam >> 16);
         io.MousePos.y = (signed short)(lParam >> 16);
         return 0;
         return 0;
     case WM_KEYDOWN:
     case WM_KEYDOWN:
+    case WM_SYSKEYDOWN:
         if (wParam < 256)
         if (wParam < 256)
             io.KeysDown[wParam] = 1;
             io.KeysDown[wParam] = 1;
         return 0;
         return 0;
     case WM_KEYUP:
     case WM_KEYUP:
+    case WM_SYSKEYUP:
         if (wParam < 256)
         if (wParam < 256)
             io.KeysDown[wParam] = 0;
             io.KeysDown[wParam] = 0;
         return 0;
         return 0;

+ 2 - 0
examples/directx9_example/imgui_impl_dx9.cpp

@@ -218,10 +218,12 @@ IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wPa
         io.MousePos.y = (signed short)(lParam >> 16);
         io.MousePos.y = (signed short)(lParam >> 16);
         return 0;
         return 0;
     case WM_KEYDOWN:
     case WM_KEYDOWN:
+    case WM_SYSKEYDOWN:
         if (wParam < 256)
         if (wParam < 256)
             io.KeysDown[wParam] = 1;
             io.KeysDown[wParam] = 1;
         return 0;
         return 0;
     case WM_KEYUP:
     case WM_KEYUP:
+    case WM_SYSKEYUP:
         if (wParam < 256)
         if (wParam < 256)
             io.KeysDown[wParam] = 0;
             io.KeysDown[wParam] = 0;
         return 0;
         return 0;