From 822eaf1751f86e5dbde754f54ccb42d7596d990a Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 25 Aug 2015 16:54:47 +0100 Subject: [PATCH] Examples: DX9, DX11: mapping missing middle mouse button. --- examples/directx11_example/imgui_impl_dx11.cpp | 6 ++++++ examples/directx9_example/imgui_impl_dx9.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/examples/directx11_example/imgui_impl_dx11.cpp b/examples/directx11_example/imgui_impl_dx11.cpp index bd0e8adb..6ac188f8 100644 --- a/examples/directx11_example/imgui_impl_dx11.cpp +++ b/examples/directx11_example/imgui_impl_dx11.cpp @@ -189,6 +189,12 @@ IMGUI_API LRESULT ImGui_ImplDX11_WndProcHandler(HWND, UINT msg, WPARAM wParam, L case WM_RBUTTONUP: io.MouseDown[1] = false; return true; + case WM_MBUTTONDOWN: + io.MouseDown[2] = true; + return true; + case WM_MBUTTONUP: + io.MouseDown[2] = false; + return true; case WM_MOUSEWHEEL: io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true; diff --git a/examples/directx9_example/imgui_impl_dx9.cpp b/examples/directx9_example/imgui_impl_dx9.cpp index 0ad0b7c5..f7cc5cd9 100644 --- a/examples/directx9_example/imgui_impl_dx9.cpp +++ b/examples/directx9_example/imgui_impl_dx9.cpp @@ -150,6 +150,12 @@ IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND, UINT msg, WPARAM wParam, LP case WM_RBUTTONUP: io.MouseDown[1] = false; return true; + case WM_MBUTTONDOWN: + io.MouseDown[2] = true; + return true; + case WM_MBUTTONUP: + io.MouseDown[2] = false; + return true; case WM_MOUSEWHEEL: io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true;