API reference
Preparing search index…

ImGui.Shortcut

  • Test and route a keyboard shortcut.

    Parameters

    key_chord
    number

    ImGuiKeyChord combining an ImGuiKey with ImGuiMod modifier bits.

    flags
    number = 0

    ImGuiInputFlags options controlling this operation; combine compatible flag bits with |.

    Returns

    boolean

    True if the chord was pressed and this call won shortcut routing under the supplied flags; false otherwise.

    A key chord combines one ImGuiKey with optional ImGuiKey.ModAlt, ImGuiKey.ModCtrl, ImGuiKey.ModShift, or ImGuiKey.ModSuper modifiers. Never combine two ImGuiKey values.

    ImGuiKey.C                  // A key or chord
    ImGuiKey.ModCtrl | ImGuiKey.C  // A chord
    

    Several callers may request the same shortcut, but only one owner receives it. Routing is independent of call order:

    • A focused parent that requests Ctrl+S receives it.
    • A focused child that also requests Ctrl+S overrides its parent.
    • A focused child that does not request Ctrl+S leaves it with its parent.

    IsKeyChordPressed() only compares modifiers and tests the key, without routing side effects. Shortcut() registers a route and tests the chord when that route is granted; it can prevent another caller from receiving the shortcut.

    Inspect registered routes in Metrics/Debugger > Inputs. This routing API is marked beta upstream.

    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0