GameSalad

Mac App: Check if mouse cursor outside the window?

ThoPelThoPel GermanyPosts: 184
edited August 2015 in Working with GS (Mac)

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 :neutral:

Small example attached.

Answers

  • fadamionfadamion Posts: 308

    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.

  • ThoPelThoPel GermanyPosts: 184

    @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

  • ArmellineArmelline Posts: 4,364

    Agree completely that some indication that the mouse is outside of the window would be a very handy thing!

  • ThoPelThoPel GermanyPosts: 184

    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

  • HopscotchHopscotch Posts: 2,555

    @ThoPel, here is an example that may help.

    Project attached.

  • ThoPelThoPel GermanyPosts: 184
    edited August 2015

    @Hopscotch Thanks, but I meant the complete app window from a mac app. :) Your example catches the problem with overlapping actors.

  • HopscotchHopscotch Posts: 2,555
    edited August 2015

    @ThoPel Ok, :)

Sign In or Register to comment.