troubleshooting Question

detect a mouse moving

Avatar of urif
urif asked on
Delphi
5 Comments1 Solution251 ViewsLast Modified:
i currently have a small application that performs background tasks every time the user moves the mouse N pixels. i am using SetWindowsHookEx together with CallNextHookEx to create the system wide mouse hook. it works just fine.
the thing is that the message returns these values:

WM_LBUTTONUP
WM_LBUTTONDOWN
WM_RBUTTONDOWN
WM_RBUTTONUP
WM_MOUSEWHEEL
WM_MOUSEMOVE

but not "mouse moving"

the problem i have at the moment is that i shouldn't perform those tasks while the mouse is moving, i should wait until the mouse stoped and then perform the task.
i tried using the system idle time but that also applies to the keyboard which is no good.

is there a way to detect (system wide) when the mouse is moving and when it's not?
sort of like:

if IsMouseMoving then
   do it
else
  don't

IsMouseMoving should return 0 for no and 1 for yes or whatever.

thanks in advance
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros