Mac App: Check if mouse cursor outside the window?
I'm searching for a solution to figure out if the mouse cursor is within the window or outside.
I tried different solution (in preview, distributed *.app, *.apk), e.g.
1.) Full screen actors with rules like Mouse Inside or Mouse Outside (The behaviors function only when switching between actors within the window.)
2.) Mouse Position X >= 1280 <= 1 (When the mouse is moving too fast, the Position X remains partially at 30px or 1260px)
3.) Small "border"-actors around the window. (When the mouse is moving too fast, the borders do not capture the mouse cursor movement.)
Nothing is working ![]()
Small example attached.
Answers
Looked at your code tried a few things not sure it will work. Might look into having some kind of a loop thats always asking if its inside then maybe if its moving cuz if its not moving for say 1 to 3 sec maybe it is outside. Just a thought.
@fadamion I tried your idea to wrap the mouse position behaviors in a timer-behavior --> didn't work (Example attached)
In my opinion I found two bugs:
1.) Mouse Inside / Mouse Outside need to capture if the mouse cursor is within the window.
2.) Mouse Position X / Y need to show a value, e.g. -1 / -1, if the mouse cursor is outside the window
Agree completely that some indication that the mouse is outside of the window would be a very handy thing!
I opened two bugs:
Bug 1337 - Mouse Inside / Mouse Outside need to capture if the mouse cursor is within the window
Bug 1338 - Mouse Position X / Y need to show a value if the mouse cursor is outside the window
@ThoPel, here is an example that may help.
Project attached.
@Hopscotch Thanks, but I meant the complete app window from a mac app.
Your example catches the problem with overlapping actors.
@ThoPel Ok,