imgui icon indicating copy to clipboard operation
imgui copied to clipboard

A way to consume mouse events?

Open wolfpld opened this issue 3 years ago • 13 comments

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.

wolfpld avatar Jul 30 '20 10:07 wolfpld