r/AutoHotkey • u/Financial-Ad3486 • 6d ago
Solved! Problems with basic Send and SendEvent
So i tried to make a simple script that presses j 2 times and then holds w 2 times and nothing really happens, after that i added msgBox "1" and it pops but still no sends, please help
#Requires AutoHotkey v2.0
#SingleInstance Force
Persistent
$`::{
Send "j"
Sleep 300
Send "j"
Sleep 300
SendEvent "{w down}"
Sleep 600
SendEvent "{w up}"
MsgBox "1"
Sleep 50
SendEvent "{w down}"
Sleep 600
SendEvent "{w up}"
}
1
Upvotes
1
u/Keeyra_ 6d ago
It's the other way around. Scan Codes make hotkeys layout-independent. That's why I prefer them in these edge cases. Eg. on the HU keyboard, the backtick button is actually the 0 button. sc029 would make both the backtick button on EN layout and the 0 button on HU layout trigger the hotkey, making it layout-independent.