Any way to trigger hotkey itself in "HotKey keyword"? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
woshichuanqilz72
Posts: 117
Joined: 05 Oct 2015, 21:23

Any way to trigger hotkey itself in "HotKey keyword"?

17 Jan 2019, 23:52

I want to dynamic change the trigger hotkey when I run ahk script, which means I need to use the keyword "hotkey".

I works fine, except I want to send the same key in the triggered label. As the code below, If I use e to trigger send e, it not worked.

How to make it? Seem no help after go through the help file.

Code: Select all

key := "f" ; not send e if I use e to trigger the label
Hotkey, %key%, MyLabel
return

MyLabel:
Send, e
Sleep, 1000
MsgBox You pressed %A_ThisHotkey%.
return
Rohwedder
Posts: 7655
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Any way to trigger hotkey itself in "HotKey keyword"?  Topic is solved

18 Jan 2019, 02:59

Hallo,
try:

Code: Select all

key := "e" ; send e if I use e to trigger the label
Hotkey, $%key%, MyLabel
return

MyLabel:
Send, e
Sleep, 1000
MsgBox You pressed %key%.
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], DataLife, ewerybody, mcd, ShatterCoder and 180 guests