Browse Source

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

pull/1692/head
omar 7 years ago
parent
commit
d6a9956781
  1. 2
      examples/directx10_example/imgui_impl_dx10.cpp
  2. 2
      examples/directx11_example/imgui_impl_dx11.cpp
  3. 2
      examples/directx9_example/imgui_impl_dx9.cpp

2
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);
return 0;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
if (wParam < 256)
io.KeysDown[wParam] = 1;
return 0;
case WM_KEYUP:
case WM_SYSKEYUP:
if (wParam < 256)
io.KeysDown[wParam] = 0;
return 0;

2
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);
return 0;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
if (wParam < 256)
io.KeysDown[wParam] = 1;
return 0;
case WM_KEYUP:
case WM_SYSKEYUP:
if (wParam < 256)
io.KeysDown[wParam] = 0;
return 0;

2
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);
return 0;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
if (wParam < 256)
io.KeysDown[wParam] = 1;
return 0;
case WM_KEYUP:
case WM_SYSKEYUP:
if (wParam < 256)
io.KeysDown[wParam] = 0;
return 0;

Loading…
Cancel
Save