diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-02 00:04:54 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-02 00:43:04 +0800 |
| commit | 47e00f7b62b0717d09504d63e9d53404250609de (patch) | |
| tree | d0024d39bea490bfca6f35df58c39f23e5d1c21d /Minecraft.Client/Windows64/Windows64_Minecraft.cpp | |
| parent | e16600a3e6b497f520178a7cb8be7a06b5c6efad (diff) | |
feat: improve mouse input handling
Diffstat (limited to 'Minecraft.Client/Windows64/Windows64_Minecraft.cpp')
| -rw-r--r-- | Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 6c6cec15..931e7f17 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -395,6 +395,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_MOUSEWHEEL: KMInput.OnMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam)); break; + case WM_MOUSEMOVE: + KMInput.OnMouseMove(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); + break; case WM_ACTIVATE: if (LOWORD(wParam) == WA_INACTIVE) KMInput.SetCapture(false); @@ -404,6 +407,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) KMInput.ClearAllState(); break; + case WM_SETCURSOR: + // Hide the OS cursor when an Iggy/Flash menu is displayed (it has its own Flash cursor) + if (LOWORD(lParam) == HTCLIENT && !KMInput.IsCaptured() && ui.GetMenuDisplayed(0)) + { + SetCursor(NULL); + return TRUE; + } + return DefWindowProc(hWnd, message, wParam, lParam); + default: return DefWindowProc(hWnd, message, wParam, lParam); } @@ -1184,7 +1196,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // Update mouse capture: capture when in-game and no menu is open { static bool altToggleSuppressCapture = false; - bool shouldCapture = app.GetGameStarted() && !ui.GetMenuDisplayed(0); + bool shouldCapture = app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL; // Left Alt key toggles capture on/off for debugging if (KMInput.IsKeyPressed(VK_MENU)) { |
