How to find out when mouse is moving

About Monkey 2 Forums Monkey 2 Programming Help How to find out when mouse is moving

This topic contains 4 replies, has 3 voices, and was last updated by  Mark Sibly 1 year, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13271

    swipis
    Participant

    Hello,

    I need to find out when mouse is moving and I found EventType.MouseMove but somehow not working as expected, here is the code:

    And output printed even if mouse not moving, what I doing wrong? Or maybe use SDL_MouseMotionEvent but not sure how…

     

    Thank you!

    #13272

    Jesse
    Participant

    double post

    #13273

    Jesse
    Participant

    On your monkey2 IDE, on the right window select:
    projects->Monkey2-develop->modules->mojox->tests->button.monkey2
    it will show you how to use mouse events.

    #13284

    swipis
    Participant

    thank you Jesse!

    #13306

    Mark Sibly
    Keymaster

    …add a method to your window class like this:

    …or, you can just ‘poll’ for mouse movement by reading Mouse.X and Mouse.Y and comparing them with older readings.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.