Page 1 of 1

Key and mouse recording

Posted: Thu Nov 12, 2020 8:37 am
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?

Re: Key and mouse recording

Posted: Fri Dec 04, 2020 12:41 pm
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