2 buttons with one
2 buttons with one
I need a script that does the following job:
if I hold down a key, for example the letter A, it automatically spams A and the left mouse button.
I need the letter a and the left mouse button to spam one after the other, and in loop.
when I release the button, it stops spamming
if I hold down a key, for example the letter A, it automatically spams A and the left mouse button.
I need the letter a and the left mouse button to spam one after the other, and in loop.
when I release the button, it stops spamming
Re: 2 buttons with one
Code: Select all
#Requires AutoHotkey v1.1.33
$a::
While GetKeyState("a", "P")
Send a{LButton}
Return
Re: 2 buttons with one
How can i set delay btw A key and left click mouse? It must to be fast and in loop
Re: 2 buttons with one
Code: Select all
#Requires AutoHotkey v1.1.33
$a::
While GetKeyState("a", "P") {
Send a
Sleep 100
Click
}
Return
Re: 2 buttons with one
doesnt work. it doesnt hve left mnouse click after a
Re: 2 buttons with one
This version releases modifiers. Test in Notepad as a first step. Use only this script, with no additions and no changes. Close other scripts first.
Code: Select all
#Requires AutoHotkey v1.1.33
$a::
SetKeyDelay 25, 25
While GetKeyState("a", "P") {
SendEvent a
Sleep 100
SendEvent {LButton}
}
Return
Re: 2 buttons with one
why doesn't it work in some games?
Re: 2 buttons with one
If this script works in Notepad but not in your game, there could be various reasons. Some programs require longer key delays (which you can adjust), or a different Send mode. Some require an elevated script (which can be run). Some block scripting. The specific sleep might require adjustment. There could be additional or alternative reasons that are difficult to determine. You may need to experiment.
Re: 2 buttons with one
If instead I want it to always click the letter A when I hold down the A key?mikeyww wrote: ↑02 Feb 2024, 17:27If this script works in Notepad but not in your game, there could be various reasons. Some programs require longer key delays (which you can adjust), or a different Send mode. Some require an elevated script (which can be run). Some block scripting. The specific sleep might require adjustment. There could be additional or alternative reasons that are difficult to determine. You may need to experiment.
Re: 2 buttons with one
You can delete the click or sending of LButton. The Send command sends whatever text you like. Have at it.