Examples: DX9, DX11: mapping missing middle mouse button.

This commit is contained in:
ocornut 2015-08-25 16:54:47 +01:00
parent 08b345efd9
commit 822eaf1751
2 changed files with 12 additions and 0 deletions

View File

@ -189,6 +189,12 @@ IMGUI_API LRESULT ImGui_ImplDX11_WndProcHandler(HWND, UINT msg, WPARAM wParam, L
case WM_RBUTTONUP: case WM_RBUTTONUP:
io.MouseDown[1] = false; io.MouseDown[1] = false;
return true; return true;
case WM_MBUTTONDOWN:
io.MouseDown[2] = true;
return true;
case WM_MBUTTONUP:
io.MouseDown[2] = false;
return true;
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f;
return true; return true;

View File

@ -150,6 +150,12 @@ IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND, UINT msg, WPARAM wParam, LP
case WM_RBUTTONUP: case WM_RBUTTONUP:
io.MouseDown[1] = false; io.MouseDown[1] = false;
return true; return true;
case WM_MBUTTONDOWN:
io.MouseDown[2] = true;
return true;
case WM_MBUTTONUP:
io.MouseDown[2] = false;
return true;
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f;
return true; return true;