Code: Select all
SendMode Play
SetKeyDelay, -1, -1, Play
windowTitle := "Some unfocused window"
WinGet, win_pid, PID, %windowTitle%
ControlFocus, , ahk_pid %win_pid%
Text := StrSplit("@r@d@fgl@d@f@")
specialChars := StrSplit("!#$%&'()*+,-/:;<=>?@[\]^_`{|}~£€´¨Øµ÷׿»«§¦¥¢¡")
Sleep 300
outer:
for k, char in Text {
for l, special in specialChars {
if (char == special){
ControlSendRaw, , %special%, ahk_pid %win_pid%
Sleep 300
continue_outer:
}
}
ControlSend, ,{%char% Down}, ahk_pid %win_pid%
Sleep 300
ControlSend, ,{%char% Up}, ahk_pid %win_pid%
Sleep 300
}
Tried this thing with ControlSendRaw, ControlSendRaw seems equally consistent/bad compared to the regular ControlSend.
I have done some testing with KeyHistory and ToolTip:
Code: Select all
^2::KeyHistory
#InstallKeybdHook
#KeyHistory 200
;When trying to ControlSend "@@@@" this returns:
;----------------------------------------------------------------
A5 138 i u 0.02 RAlt
A5 138 i d 0.19 RAlt
A5 138 i u 0.02 RAlt
A5 138 i d 0.23 RAlt
A5 138 i u 0.02 RAlt
A5 138 i d 0.28 RAlt
A5 138 i u 0.02 RAlt
A5 138 i d 0.17 RAlt
;When I am writing on my keyboard it picks up everything like it should. I think KeyHistory works as intended for that, maybe it doesn't do what it should for ControlSend?
;-----------------------------------------------------------------
;Have also tried ToolTipping to see last key, didn't gain any valuable knowledge from that either.
loop{
ToolTip, %a_priorkey%
Sleep 100
}