Merge pull request #271 from TwilitRealm/26-04-07-hide-cursor

Hide mouse cursor when imgui hidden
This commit is contained in:
TakaRikka
2026-04-07 16:51:24 -07:00
committed by GitHub
+6
View File
@@ -12,6 +12,7 @@
#include "ImGuiConsole.hpp"
#include "JSystem/JUtility/JUTGamePad.h"
#include "SDL3/SDL_mouse.h"
#include "dusk/config.hpp"
#include "dusk/settings.h"
#include "dusk/audio/DuskAudioSystem.h"
@@ -217,9 +218,14 @@ namespace dusk {
if (CheckMenuViewToggle(ImGuiKey_F1, m_isHidden)) {
ShowToasts();
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
SDL_HideCursor();
return;
}
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouseCursorChange;
// Imgui will re-show cursor.
// TODO: we need to be able to render the menu bar & any overlays separately
// The code currently ties them all together, so hiding the menu hides all windows