Is there an easy way to consume mouse/keyboard input events?

I want to cosume input events when a player performs certain action like clicking OK button on GUI to prevent other GUI/Game elements from responding to the event.

Wrapping Unity’s Input class with my own custom class might work but it sounds awkward as I’m using lots of store assets and I will need to replace all the Input usage in every script.

Is there any easy way to consume input event?

https://docs.unity3d.com/Documentation/ScriptReference/Event.Use.html