Disable/enable the mouse clicks / taps temporarily


Is there a way to disable/enable the mouse clicks / taps temporarily ?

I need this in the following situation:

I "Hide the Mouse Cursor" and save the mouse position (with the standard actions)
move it to a given x/y position on the screen to get the color at that position,
set some variables depending on the detected color and then "Restore the Mouse position" and "unhide the Mouse cursor" again.

Works fine,
except when I click/tap during this very very short time the above needs to run, the mouse-click will activate whatever is then at the cursor.
Not a big deal, but it would be nice to avoid this somehow.

Who would know how to tackle this ?


BTT 4.0 (2213) / Mac M1 Max OS 13.2 (22D49)
BTT plugin Stream Deck option
Stream Deck Mobile (on iPad Air)