Is this only for the mouse?
Probably just map out the location of the button in screen x/y coordonates and validate all clicks against the area where the button should be to ensure they do not line up.
You can get the mouse click and screen position off the mouse click action on any controller type blueprint as if it were any other input.
You can only get the position of the button if you know it, or of you cast to and query the correct values for it off the UI widget…
If you set things up smart, with anchors, you can predict that the button is always at X% of screen.
If you put it in a corner, then you can say
“All clicks >= 90x and 90y are on the button”.
Makes it a bit easier.
(You dont have to check that its also <= 95 to confirm its off the button to the right/lower corner for instance).