tracking mouse movements

This is a discussion on tracking mouse movements within the Windows Programming forums, part of the Platform Specific Boards category; hi, i want to make a little program that would record my mouse movements precisely. at the moment i am ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    33

    Question tracking mouse movements

    hi,

    i want to make a little program that would record my mouse movements precisely. at the moment i am using WM_MOUSEMOVE message, but it seems to skip quite alot of pixels. i would like to at this stage just record each x,y coord the mouse moves through, and maybe later actually record the speed of the mouses movement too. i use a vector and everytime a mousemove message is recieved i just pushback the current x,y value into 2 vectors.

    is it the vectors that are slowing this down? any example programs anyone knows of that i can have a look at?

    What i plan to do is save the mouse movements and use them to move some sprites around the screen.
    werdy666!

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    but it seems to skip quite alot of pixels
    The mouse pointer doesn't move 1 pixel at a time, if that's what you thought .
    That would mean that if you had a resolution of 1024x768, you would need a framerate at 1024 fps to move the mousepointer from the left side to the right side over 1 second, and that's a framerate you can only dream about .
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    33

    Talking

    but surely it is possible somehow??? i remember my old Amiga 500 used to be able to record your mouse movements and replay them perfectly. Any tips????

    Thanks for your reply!
    werdy666!

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Have a look at GetMouseMovePointsEx() on MSDN

  5. #5
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    If you still (for some weird reason ) want all points the mouse pointer "should" have been at, make a line between the current mouse position and the position it was at in the last frame. Then calculate every possible point in-between.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drawing a user's mouse movements
    By John_L in forum C# Programming
    Replies: 0
    Last Post: 11-07-2007, 05:16 PM
  2. Pick up mouse movements and clicks
    By Zishaan in forum Game Programming
    Replies: 3
    Last Post: 03-28-2007, 01:20 PM
  3. need Help in Mouse Pointer
    By obaid in forum C++ Programming
    Replies: 3
    Last Post: 12-07-2006, 03:33 AM
  4. Problem in mouse position
    By Arangol in forum Game Programming
    Replies: 6
    Last Post: 08-08-2006, 08:07 AM
  5. Tracking the mouse
    By Nor in forum Windows Programming
    Replies: 5
    Last Post: 01-30-2002, 09:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21