Code: Select all
;Gui Add, Button, gSubRoutine, Button ; With this line, 'Send msg{Space}' in 'F6::' works!!!
Gui Show, x100 y100 w100 h100
return
SubRoutine:
!^+m::
::msg::
MsgBox This is a MsgBox.
return
F8:: ; Is intended to be defined in another script!
Send !^+m ; Triggering a hotkey.
return
F7:: ; Is intended to be defined in another script!
SendLevel 1
Send msg{Space} ; Triggering a hotstring.*
SendLevel 0
return
F6:: ; Is intended to be defined in another script!
Send msg{Space} ; Triggering a hotstring.*
return
GuiClose:
ExitApp
return
; * HotString Help: By default, hotstrings are never triggered by keystrokes produced by any AutoHotkey script.
; ...this behaviour can be controlled with #InputLevel and SendLevel.
Are there other (better) methods?
With a small adaptation (SendLevel, F7::) also hotstrings can be used. My second question is a newbie understanding issue: If the first line is included in the demo script, the subroutine is triggered by Send & hotstring (F6::) without 'SendLevel 1', or even with 'SendLevel 0'!!! Why?