Skip to content

A way to consume mouse events? #3370

@wolfpld

Description

@wolfpld

Hi,
Is there a way to consume certain mouse events (e.g. button click, dragging)? Example pseudocode:

if( condition && IsMouseClicked( 0 ) )
{
    ConsumeMouseClick( 0 );
}
if( IsMouseClicked( 0 ) )
{
    // should not activate if 'condition' is true
}

The use case for this would be handling interaction with overlays, which should prevent clicks going to UI elements underneath the overlay.

So far I had limited success directly manipulating ImGui IO structure, but I don't know how robust it is and what assumptions are made about preservation of the state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions