API reference
Preparing search index…

ImGui.SetItemKeyOwner

  • Assign input ownership to the last item.

    Parameters

    key
    number

    ImGuiKey logical key identifier, not a platform-native key code.

    Returns

    void
    • One common use case would be to allow your items to disable standard inputs behaviors such as Tab or Alt key handling, Mouse Wheel scrolling, etc. e.g. Button(...); SetItemKeyOwner(ImGuiKey.MouseWheelY); to make hovering/activating a button disable wheel for scrolling.

    • Reminder ImGuiKey enum include access to mouse buttons and gamepad, so key ownership can apply to them.

    • Many related features are still in imgui_internal.h. For instance, most IsKeyXXX()/IsMouseXXX() functions have an owner-id-aware version.

    Call SetItemKeyOwner(key) to assign the key to the last item when that item is hovered or active. The lower-level native ownership API is not exported.

    Source & inheritance

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