ImGuiFullscreen: Default input source to keyboard if none

This commit is contained in:
Stenzek 2024-11-05 14:12:41 +10:00
parent 88e14dd3ff
commit 57ca5dd2c2
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -675,8 +675,12 @@ ImGuiFullscreen::FocusResetType ImGuiFullscreen::GetQueuedFocusResetType()
void ImGuiFullscreen::ForceKeyNavEnabled()
{
ImGuiContext& g = *ImGui::GetCurrentContext();
g.ActiveIdSource = (g.ActiveIdSource == ImGuiInputSource_Mouse) ? ImGuiInputSource_Keyboard : g.ActiveIdSource;
g.NavInputSource = (g.NavInputSource == ImGuiInputSource_Mouse) ? ImGuiInputSource_Keyboard : g.ActiveIdSource;
g.ActiveIdSource = (g.ActiveIdSource == ImGuiInputSource_Mouse || g.ActiveIdSource == ImGuiInputSource_None) ?
ImGuiInputSource_Keyboard :
g.ActiveIdSource;
g.NavInputSource = (g.NavInputSource == ImGuiInputSource_Mouse || g.NavInputSource == ImGuiInputSource_None) ?
ImGuiInputSource_Keyboard :
g.ActiveIdSource;
g.NavDisableHighlight = false;
g.NavDisableMouseHover = true;
}