Plugin Mouse losing focus?

I’m starting to learn Plugins and I’ve noticed that my .Button1Down event looses it’s capability once focus is lost on studio or another tool suches as drag or resize is selected?

Is there a way around this or how to refocus it again?