diff options
Diffstat (limited to 'Minecraft.Client/Windows64/Windows64_Minecraft.cpp')
| -rw-r--r-- | Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index e24bc374..7d38ff99 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -403,6 +403,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (LOWORD(wParam) == WA_INACTIVE) KMInput.SetCapture(false); break; + case WM_SETFOCUS: + { + // Re-capture when window receives focus (e.g., after clicking on it) + Minecraft *pMinecraft = Minecraft::GetInstance(); + bool shouldCapture = pMinecraft && app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL; + if (shouldCapture) + KMInput.SetCapture(true); + } + break; case WM_KILLFOCUS: KMInput.SetCapture(false); KMInput.ClearAllState(); |
