Alternate remap script Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Zephyury
Posts: 2
Joined: 29 Sep 2022, 20:49

Alternate remap script

Post by Zephyury » 29 Sep 2022, 21:21

Hi! I'm new to ahk and I'm trying to find alternatives to the a::b script or remap script

Code: Select all

toggle := true
return

\::toggle := !toggle

#If toggle
 ~$LButton::
    While GetKeyState("LButton", "P")
        Click
        Sleep 50  ;  milliseconds
{}return

x::6

g::7

e::5
the problem with this is that it weirdly bugs out sometimes when I am autoclicking. let's say I am holding down my left mouse button and trying to press x, it sometimes gives it like a second before doing the input, putting me in this lag state and me not being able to move my mouse. Just hoping to find an alternative, Thank you!

User avatar
mikeyww
Posts: 26888
Joined: 09 Sep 2014, 18:38

Re: Alternate remap script  Topic is solved

Post by mikeyww » 29 Sep 2022, 21:51

Test your script in Notepad. {} probably has no role. Indentation looks nice, but if you want a functional block, use braces.

Code: Select all

Gosub, \

\::
on := !on
SoundBeep, 1000 + 500 * on
Return

#If on
x::6
LButton::
SetKeyDelay, 50
While GetKeyState("LButton", "P")
 Send {LButton}
Return
#If
AHK v1 is single-threaded. In this script, triggering a hotkey will interrupt another hotkey routine that is executing at that time.

Post Reply

Return to “Ask for Help (v1)”