mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Nav, InputText: Fixed accidental menu toggling while typing non-ascii characters using AltGR. (#370)
This commit is contained in:
parent
4540177ce7
commit
21428ad3f4
@ -45,6 +45,7 @@ Other Changes:
|
||||
- Window: Fix IsWindowAppearing() from returning true twice in most cases. (#3982, #1497, #1061)
|
||||
- Nav: Fixed using SetItemDefaultFocus() on windows with _NavFlattened flag.
|
||||
- Nav: Fixed toggling menu layer while an InputText() is active not stealing active id.
|
||||
- Nav, InputText: Fixed accidental menu toggling while typing non-ascii characters using AltGR. [@rokups] (#370)
|
||||
- Tables: Expose TableSetColumnEnabled() in public api. (#3935)
|
||||
- Tables: Better preserve widths when columns count changes. (#4046)
|
||||
- TabBar: Fixed mouse reordering with very fast movements (e.g. crossing multiple tabs in a single
|
||||
|
10
imgui.cpp
10
imgui.cpp
@ -9039,8 +9039,16 @@ static void ImGui::NavUpdate()
|
||||
io.NavInputs[ImGuiNavInput_TweakSlow] = 1.0f;
|
||||
if (io.KeyShift)
|
||||
io.NavInputs[ImGuiNavInput_TweakFast] = 1.0f;
|
||||
if (io.KeyAlt && !io.KeyCtrl) // AltGR is Alt+Ctrl, also even on keyboards without AltGR we don't want Alt+Ctrl to open menu.
|
||||
|
||||
// AltGR is normally Alt+Ctrl but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl)
|
||||
// But also even on keyboards without AltGR we don't want Alt+Ctrl to open menu anyway.
|
||||
if (io.KeyAlt && !io.KeyCtrl)
|
||||
io.NavInputs[ImGuiNavInput_KeyMenu_] = 1.0f;
|
||||
|
||||
// We automatically cancel toggling nav layer when any text has been typed while holding Alt. (See #370)
|
||||
if (io.KeyAlt && !io.KeyCtrl && g.NavWindowingToggleLayer && io.InputQueueCharacters.Size > 0)
|
||||
g.NavWindowingToggleLayer = false;
|
||||
|
||||
#undef NAV_MAP_KEY
|
||||
}
|
||||
memcpy(io.NavInputsDownDurationPrev, io.NavInputsDownDuration, sizeof(io.NavInputsDownDuration));
|
||||
|
Loading…
Reference in New Issue
Block a user