mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-02 12:37:20 +01:00
Nav: Fixed an issue where Alt key would clear current active item on windows with the ImGuiWindowFlags_NoNavInputs flag. (#8231)
This commit is contained in:
parent
f5f11e94be
commit
13c4084362
@ -48,6 +48,8 @@ Other changes:
|
||||
- Drags: Added ImGuiSliderFlags_NoSpeedTweaks flag to disable keyboard
|
||||
modifiers altering the tweak speed. Useful if you want to alter tweak speed
|
||||
yourself based on your own logic. (#8223)
|
||||
- Nav: Fixed an issue where Alt key would clear current active item on
|
||||
windows with the ImGuiWindowFlags_NoNavInputs flag. (#8231)
|
||||
- Backends: Vulkan: Fixed setting VkSwapchainCreateInfoKHR::preTransform for
|
||||
platforms not supporting VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR. (#8222) [@Zer0xFF]
|
||||
|
||||
|
21
imgui.cpp
21
imgui.cpp
@ -4356,7 +4356,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
|
||||
|
||||
// This could be written in a more general way (e.g associate a hook to ActiveId),
|
||||
// but since this is currently quite an exception we'll leave it as is.
|
||||
// One common scenario leading to this is: pressing Key ->NavMoveRequestApplyResult() -> ClearActiveId()
|
||||
// One common scenario leading to this is: pressing Key ->NavMoveRequestApplyResult() -> ClearActiveID()
|
||||
if (g.InputTextState.ID == g.ActiveId)
|
||||
InputTextDeactivateHook(g.ActiveId);
|
||||
}
|
||||
@ -13625,15 +13625,16 @@ 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;
|
||||
break;
|
||||
}
|
||||
if (g.NavWindow != NULL && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
|
||||
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;
|
||||
break;
|
||||
}
|
||||
if (g.NavWindowingToggleLayer && g.NavInputSource == ImGuiInputSource_Keyboard)
|
||||
{
|
||||
// We cancel toggling nav layer when any text has been typed (generally while holding Alt). (See #370)
|
||||
|
Loading…
x
Reference in New Issue
Block a user