Mouse location question

I searched the forums, but couldn’t locate what I was looking for.

Is there a way to tell if your mouse is offstage, and if so do an function?

Case