diff --git a/Dalamud/Interface/InterfaceManager.cs b/Dalamud/Interface/InterfaceManager.cs index 2252c5d53..54b3548ac 100644 --- a/Dalamud/Interface/InterfaceManager.cs +++ b/Dalamud/Interface/InterfaceManager.cs @@ -155,6 +155,7 @@ namespace Dalamud.Interface this.scene = new RawDX11Scene(swapChain); this.scene.ImGuiIniPath = Path.Combine(Path.GetDirectoryName(this.dalamud.StartInfo.ConfigurationPath), "dalamudUI.ini"); this.scene.OnBuildUI += Display; + this.scene.OnNewInputFrame += OnNewInputFrame; var fontPathJp = Path.Combine(this.dalamud.StartInfo.WorkingDirectory, "UIRes", "NotoSansCJKjp-Medium.otf"); ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathJp, 17.0f, null, ImGui.GetIO().Fonts.GetGlyphRangesJapanese()); @@ -222,6 +223,20 @@ namespace Dalamud.Interface return this.setCursorHook.Original(hCursor); } + private void OnNewInputFrame() + { + // fix for keys in game getting stuck, if you were holding a game key (like run) + // and then clicked on an imgui textbox - imgui would swallow the keyup event, + // so the game would think the key remained pressed continuously until you left + // imgui and pressed and released the key again + if (ImGui.GetIO().WantTextInput) + { + this.dalamud.ClientState.KeyState.ClearAll(); + } + + // TODO: mouse state? + } + private void Display() { // this is more or less part of what reshade/etc do to avoid having to manually diff --git a/lib/ImGuiScene b/lib/ImGuiScene index dda60b7fa..d0c03cd31 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit dda60b7faa1b12225d165d9e5d239e7e66648aae +Subproject commit d0c03cd31dac7a3eede52a467ef81def69f87ef9