raysan5 / raygui

A simple and easy-to-use immediate-mode gui library
zlib License
3.26k stars 280 forks source link

Input blocking / input event consuming #384

Open ssoher opened 4 months ago

ssoher commented 4 months ago

Currently if user clicks where two controls overlap, both controls activate. The first control that is drawn on top should "consume" the input event and the one behind that should not get activated in such cases.

raysan5 commented 2 months ago

@ssoher Events consumption does not depend on raygui but on the underlying inputs mnagement layer, in this case raylib. It seems an issue that could only affects on some specific use cases, dependant on UI design.

ssoher commented 2 months ago

If the assumption is "GUI controls can never ever overlap" then in its current state there is no problem. But when we allow the user to alter the GUI dynamically (move, scale) then it becomes a problem. But I understand if it's the library user's responsibility to track the state of input and check if any gui item is already interacted with in a given frame so that other controls return early/don't do anything.