mirror of https://github.com/ocornut/imgui
Nav: pressing any keyboard key while holding Alt disable toggling nav layer on Alt release. (#4439, extend #370, #369)
This commit is contained in:
parent
193c1e2366
commit
d16cb171c6
|
@ -43,6 +43,8 @@ Breaking changes:
|
|||
|
||||
Other changes:
|
||||
|
||||
- Nav: pressing any keyboard key while holding Alt disable toggling nav layer on Alt release. (#4439)
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
VERSION 1.91.1 (Released 2024-09-04)
|
||||
-----------------------------------------------------------------------
|
||||
|
|
|
@ -13182,9 +13182,11 @@ static void ImGui::NavUpdateWindowing()
|
|||
|
||||
// Keyboard: Press and Release ALT to toggle menu layer
|
||||
const ImGuiKey windowing_toggle_keys[] = { ImGuiKey_LeftAlt, ImGuiKey_RightAlt };
|
||||
bool windowing_toggle_layer_start = false;
|
||||
for (ImGuiKey windowing_toggle_key : windowing_toggle_keys)
|
||||
if (nav_keyboard_active && IsKeyPressed(windowing_toggle_key, 0, ImGuiKeyOwner_NoOwner))
|
||||
{
|
||||
windowing_toggle_layer_start = true;
|
||||
g.NavWindowingToggleLayer = true;
|
||||
g.NavWindowingToggleKey = windowing_toggle_key;
|
||||
g.NavInputSource = ImGuiInputSource_Keyboard;
|
||||
|
@ -13198,7 +13200,9 @@ static void ImGui::NavUpdateWindowing()
|
|||
// We cancel toggling nav layer if an owner has claimed the key.
|
||||
if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper)
|
||||
g.NavWindowingToggleLayer = false;
|
||||
if (TestKeyOwner(g.NavWindowingToggleKey, ImGuiKeyOwner_NoOwner) == false || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_NoOwner) == false)
|
||||
else if (windowing_toggle_layer_start == false && g.LastKeyboardKeyPressTime == g.Time)
|
||||
g.NavWindowingToggleLayer = false;
|
||||
else if (TestKeyOwner(g.NavWindowingToggleKey, ImGuiKeyOwner_NoOwner) == false || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_NoOwner) == false)
|
||||
g.NavWindowingToggleLayer = false;
|
||||
|
||||
// Apply layer toggle on Alt release
|
||||
|
|
Loading…
Reference in New Issue