I just need some help with a simple key-recorder that would allow me to reproduce the same keystrokes with the same timing.
This is what I came up with so far:
So then I copypaste the log into my script and bind it to a hotkey to repeat the same actions.#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MaxHotkeysPerInterval 100
Process, Priority,, High
F11::
SoundBeep
FileDelete, keylog.txt
Reload
return
~LAlt::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {LAlt down}`n, keylog.txt
KeyWait, LAlt
FileAppend, sleep %A_TimeSinceThisHotkey%`n, keylog.txt
FileAppend, Sendinput {LAlt up}`n, keylog.txt
return
~vk41 down::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk41 down}`n, keylog.txt
KeyWait, vk41
return
~vk41 up::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk41 up}`n, keylog.txt
return
~vk44 down::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk44 down}`n, keylog.txt
KeyWait, vk44
return
~vk44 up::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk44 up}`n, keylog.txt
return
~vk53 down::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk53 down}`n, keylog.txt
KeyWait, vk53
return
~vk53 up::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk53 up}`n, keylog.txt
return
~vk57 down::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk57 down}`n, keylog.txt
KeyWait, vk57
return
~vk57 up::
FileAppend, sleep %A_TimeSincePriorHotkey%`n, keylog.txt
FileAppend, Sendinput {vk57 up}`n, keylog.txt
return
The problem is that there seems to be some sort of delay with the recording, which in result is not very accurate, especially if the keystrokes are done fast enough.
Here's an example:
So is there a way to make it work more reliably, without skipping any keystrokes so that it would accurately record everything?
Thanks in advance!