AutoHotKey: Pressing two keys simultaneously without repeats

Is there a way to press two keys simultaneously and bind it to a macro key (for example, pressing “s” and “d” simultaneously and then bind it to “a” key) without it having the “s” repeat multiple times when a is pressed?

Another example –
I wrote the script in AutoHotKey as:

a::
SendInput {s down}{d down}{s up}{d up}
return

And when I test the script in Notepad, it shows the “s” being repeated multiple times with one click of “a”

Is there a way for “s” and “d” to be pressed simultaneously without having it to repeat but will stay enabled as long as “a” is pressed with no delays? Or is there a way to fix the script so that “s” and “d” can be pressed simultaneously without it being spammed?

Any help would be greatly appreciated!

Answer

thsdt test script works for me sdll the time i press sd key. sdbcdefghij. sdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsd if i hold down sd (errr… the A key).

If you want the holdoff for the key repeat to be slower so your system takes longer to start repeating after you hold down a key, adjust your keyboard settings in control panel. At some point however the keys will start to repeat.

Attribution
Source : Link , Question Author : AutoHotKeyNewbie , Answer Author : JJohnston2

Leave a Comment