Check if mouse is down while in Edit Mode

How can I simply check if the mouse if held while in edit mode? The edit mode equivalent of Input.GetMouseButton(0)

To be clear: I do NOT mean tracking mouse events. I also don’t mean for a specific window - I mean at all. There are already tons of answers for specific events and individual windows.

I’m just looking for a straight-up solution for “is the left mouse button currently held”. Thank you!

from the category “bodged but works somewhat” i present thee this code:

public class testscript :MonoBehaviour
    public void Update()
        if (Input.GetMouseButton(0))

    void OnDrawGizmos()
        // Your gizmo drawing thing goes here if required...

        // Ensure continuous Update calls.
        if (!Application.isPlaying)

i want to stress the somewhat specifically as this for example can miss clicks if you only check for MouseButtonDown instead of MouseButton.

But perhaps this is something that helps you find a better solution or someone else has something better at hand. Would be curious to see if there is a good solution to this.

Let me know what you think