Key and mouse recording

Just starting out? Need help? Post your questions and find answers here.
kinglestat
Enthusiast
Enthusiast
Posts: 732
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Key and mouse recording

Post by kinglestat »

I am trying to capture keyboard and mouse movement to record them for AutoIt much like au3record..for those who use autoit; mainly as I wish to add the timer delay capability
Are there any examples on how I can intercept keystrokes and mouse clicks, without disrupting a running program?
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
User avatar
TheAutomator
Enthusiast
Enthusiast
Posts: 112
Joined: Tue Dec 01, 2020 8:33 pm

Re: Key and mouse recording

Post by TheAutomator »

Take a look at the UDF Autoit uses to capture keypresses and mouse locations:

Misc.au3 -> _IsPressed ( $sHexKey [, $vDLL = "user32.dll"] )

If you open that file you'll get plenty of info to work with :)

Now for capturing mouse movement, i would take this kind of approach if you want tot mimic every little move.
Pseudocode:

Code: Select all

procedure record_mouse()
   repeat
      if mouse X or Y changes
         save time from timer + mouse X and mouse Y
      endif
   until ispressed(stopbutton)
endprocedure
hope that helps!

Regards
Post Reply