"Hotkey" command - strange behavior Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AndrewKun
Posts: 24
Joined: 03 Jun 2015, 12:03

"Hotkey" command - strange behavior

02 Jun 2017, 11:27

Hi guys

I'm seeing some strange behavior with the Hotkey function. For example, this script is working

Code: Select all

Var = space

Hotkey, %Var%, Action
return

Action:
	MsgBox, action test
return
But if I change the Var using another hotkey, it stops working, even though the Var value is set successfully

Code: Select all

^q::Var = space

Hotkey, %Var%, Action
return

Action:
	MsgBox, action test
return
Then, if I take the first, working script, and place a block comment at the start...:

Code: Select all

/*comment*/

Var = space

Hotkey, %Var%, Action
return

Action:
	MsgBox, action test
return
The script doesn't even run! All I did is placed a single comment string. Can you please explain why it doesn't work in examples 2 and 3? Looks like a bug to me.
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: "Hotkey" command - strange behavior  Topic is solved

02 Jun 2017, 12:42

Hallo,
1. script is working
2. script: the Auto-execute Section ends with "^q::Var = space"
so "Hotkey, %Var%, Action" was not executed.
The whole 3. script is a comment because there is no comment end.
*/ must be at the beginning of a line.
AndrewKun
Posts: 24
Joined: 03 Jun 2015, 12:03

Re: "Hotkey" command - strange behavior

03 Jun 2017, 05:20

Rohwedder wrote:Hallo,
1. script is working
2. script: the Auto-execute Section ends with "^q::Var = space"
so "Hotkey, %Var%, Action" was not executed.
The whole 3. script is a comment because there is no comment end.
*/ must be at the beginning of a line.
Thanks! Really sorry for the lame questions, but those are some nuances I wasn't aware of.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: dipahk, Nerafius and 193 guests