mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-12 02:00:58 +01:00
Shortcuts: claim mods ownership once pressed. (#456, #2637, #2620, #2891, #3370, #3724, #4828, #5108, #5242, #5641)
This commit is contained in:
parent
1002cfa6d2
commit
c150ad50c4
@ -9743,6 +9743,10 @@ bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID own
|
||||
|
||||
if (!IsKeyChordPressed(key_chord, flags, owner_id))
|
||||
return false;
|
||||
|
||||
// Claim mods during the press
|
||||
SetKeyOwnersForKeyChord(key_chord & ImGuiMod_Mask_, owner_id);
|
||||
|
||||
IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function!
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user