Howto: Distinguish between short and long Button click

Hello guys!

I need to differentiate between a short and long button click.
I noticed that the button returns true when it is released after a click.
If I could just get the button real state (pressed or not), I would be able to differentiate between different kinds of click duration.

Is there anyway to get the real button state?
Do you guys know any other way I could achieve it?

Thanks!

You can use IsItemActive() to check if it is being held.

The timer is not exposed publicly, but you can access if you include imgui_internal.h and access
GImGui->ActiveIdTimer when IsItemActive() returns true.