nonexistent hotkey?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Xaucy
Posts: 6
Joined: 19 Nov 2023, 22:59

nonexistent hotkey?

24 Apr 2024, 14:37

Code: Select all

SetControlDelay, -1
SetWinDelay, -1
SetMouseDelay, -1
SetKeyDelay, -1
SetBatchLines, -1
ListLines Off
Process, Priority,, High
#Persistent
#KeyHistory 0
#NoEnv

SendMode, Input

end::
Hotkey, LButton, Off
Sleep 10
Send {Click}
Sleep 10+
Send, {1}{RButton}
Sleep 20
Hotkey, LButton, On
Return
My goal is to disable LButton during the code and enable it after but when I use the script I get nonexistent hotkey so i'm just lost.
Image
User avatar
mikeyww
Posts: 27136
Joined: 09 Sep 2014, 18:38

Re: nonexistent hotkey?

24 Apr 2024, 23:34

Hello,

Hotkeys that you can manage via AHK are defined as hotkeys in your script. If a hotkey does not exist, then you cannot disable it, right?

How can you avoid this issue?
  1. Use IsLabel.
  2. Use Try.
  3. Use a variable to track status.

Code: Select all

#Requires AutoHotkey v1.1.33.11

End::
disabled := True
SoundBeep 1500
Sleep 3000
SoundBeep 1000
disabled := False
Return

#If disabled
LButton::Return
#If

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Marium0505, Sarhad and 117 guests