I'm trying to make a simple macro recorder that records what a user types in and saves it. However, to get modifier keys to work with what I've made so far, I need to press and release the modifier and then the press and release the key. This won't do because I want to be able to record as I see what I'm doing - say, for example, I am navigating a program with various GUIs with various &hotkeys and I want to record a macro on the fly. If I press Alt+e to activate a button that opens, say, an editing window, where I will continue recording my macro, I would have to press and release alt and then press and release e, which would not press the button (in fact, it might do something else entirely, like open the edit menu).
I've noticed AutoScriptWriter adds {Control Down} and {Control Up} when Ctrl is pressed. How does it do this?
Here's the snippet of my attempts thus far:
text := ""
Again:
Input, text, V L1, {Control Down}{Control Up}{LAlt}{RAlt}{LWin}{LShift}{RShift}{BS}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{Capslock}{Numlock}{PrintScreen}{Pause}{Escape}
IfInString, ErrorLevel, EndKey
{
StringTrimLeft, ErrorLevel, ErrorLevel, 7
If (ErrorLevel != "Pause")
script := script text "{" ErrorLevel "}"
else if (ErrorLevel = "Pause")
{
script := script text
goto End
}
ToolTip, %script%
goto Again
}
script := script text
ToolTip, %script%
goto Again
End:
Tooltip
returnThanks!




