Jump to content

Mouse Moves


Kbalz
 Share

Recommended Posts

Hello, kind of a general hardware question here, but this is information I must know for my mouse simulation project.

When I move the mouse (using the actual mouse hardware), the cursor moves.. Say I have a steady hand I move my mouse directly up.. from Screen Coords 100 X 200 to 100 X 100. Does the cursor 'touch' every pixel on the line..? Or depending on speed, does it jump 3-4 pixels at a time? Even if the FPS can't keep up with displaying the cursor at high speeds, does the OS register every single pixel move?

Thanks, Kb.

Link to comment
Share on other sites

Hello, kind of a general hardware question here, but this is information I must know for my mouse simulation project.

When I move the mouse (using the actual mouse hardware), the cursor moves.. Say I have a steady hand I move my mouse directly up.. from Screen Coords 100 X 200 to 100 X 100. Does the cursor 'touch' every pixel on the line..? Or depending on speed, does it jump 3-4 pixels at a time? Even if the FPS can't keep up with displaying the cursor at high speeds, does the OS register every single pixel move?

Thanks, Kb.

Windows reads a register periodically, as in many times a second, where the accumulated change in mouse X/Y is stored. Then the mouse "jumps" to the newly calculated coordinates. This only looks smooth when the polling of the mouse takes place at a high enough rate (every 50ms or less, say). If your system is busy enough, that polling happens less often and you can actually "see" the jumpiness in the mouse cursor across the screen.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Windows reads a register periodically, as in many times a second, where the accumulated change in mouse X/Y is stored. Then the mouse "jumps" to the newly calculated coordinates. This only looks smooth when the polling of the mouse takes place at a high enough rate (every 50ms or less, say). If your system is busy enough, that polling happens less often and you can actually "see" the jumpiness in the mouse cursor across the screen.

:)

Thanks for your reply. My project is actually based on AutoItx's move mouse function call, the one that takes two coordinate sets, and a speed parameter. AutoIT's version moves directly from PointA to PointB, and slows very slightly as it gets closer to PointB and kind of simulates a human slowing down the mouse so that the destination is reached.

My project expands on this to move from PointA to PointB, but much more human-like.. dynamically curving the approach, over/under shooting the destination point randomly (then adjusting again toward PointB), and more (randomized) speed variation at the start/end of the mouse move. Its coming along very nicely, but I'm moving one pixel at a time, making it very robotic compared to me moving the hardware-mouse.

Anyways, this information should help since I can skip some pixels along the way. Thanks!

Edited by Kbalz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...