From 59a62aaaf07db8ec74f0df25e96c70d105e8ed27 Mon Sep 17 00:00:00 2001 From: "Andrew P. Harper" <115321970+KoopaCode@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:37:47 -0500 Subject: [PATCH] Update Windows64_Minecraft.cpp Fixes ALT+Enter not being persistent like F11 --- .../Windows64/Windows64_Minecraft.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 49c43ceac..1784f9642 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -823,6 +823,23 @@ HRESULT InitDevice() } if( FAILED( hr ) ) return hr; + + IDXGIDevice* dxgiDevice = NULL; + if (SUCCEEDED(g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&dxgiDevice)) && dxgiDevice) + { + IDXGIAdapter* dxgiAdapter = NULL; + if (SUCCEEDED(dxgiDevice->GetParent(__uuidof(IDXGIAdapter), (void**)&dxgiAdapter)) && dxgiAdapter) + { + IDXGIFactory* dxgiFactory = NULL; + if (SUCCEEDED(dxgiAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&dxgiFactory)) && dxgiFactory) + { + dxgiFactory->MakeWindowAssociation(g_hWnd, DXGI_MWA_NO_ALT_ENTER); + dxgiFactory->Release(); + } + dxgiAdapter->Release(); + } + dxgiDevice->Release(); + } // Create a render target view ID3D11Texture2D* pBackBuffer = NULL; @@ -1597,6 +1614,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, ToggleFullscreen(); } + // Alt+Enter Toggle fullscreen + if (g_KBMInput.IsKeyPressed(VK_RETURN) && + (g_KBMInput.IsKeyDown(VK_LMENU) || g_KBMInput.IsKeyDown(VK_RMENU))) + { + ToggleFullscreen(); + } + // TAB opens game info menu. - Vvis :3 - Updated by detectiveren if (g_KBMInput.IsKeyPressed(VK_TAB) && !ui.GetMenuDisplayed(0)) {