Shortcut

Inputs Utilities: Shortcut Testing & Routing BETA - ImGuiKeyChord = a ImGuiKey + optional ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super. ImGuiKey_C // Accepted by functions taking ImGuiKey or ImGuiKeyChord arguments) ImGuiMod_Ctrl | ImGuiKey_C // Accepted by functions taking ImGuiKeyChord arguments) only ImGuiMod_XXX values are legal to combine with an ImGuiKey. You CANNOT combine two ImGuiKey values. - The general idea is that several callers may register interest in a shortcut, and only one owner gets it. Parent -> call Shortcut(Ctrl+S) // When Parent is focused, Parent gets the shortcut. Child1 -> call Shortcut(Ctrl+S) // When Child1 is focused, Child1 gets the shortcut (Child1 overrides Parent shortcuts) Child2 -> no call // When Child2 is focused, Parent gets the shortcut. The whole system is order independent, so if Child1 makes its calls before Parent, results will be identical. This is an important property as it facilitate working with foreign code or larger codebase. - To understand the difference: - IsKeyChordPressed() compares mods and call IsKeyPressed() -> function has no side-effect. - Shortcut() submits a route, routes are resolved, if it currently can be routed it calls IsKeyChordPressed() -> function has (desirable) side-effects as it can prevents another call from getting the route. - Visualize registered routes in 'Metrics/Debugger->Inputs'.

pure @nogc nothrow @trusted
bool
Shortcut
(
ImGuiKeyChord key_chord
,
ImGuiInputFlags flags
)

Meta