ahkpp
ahkpp copied to clipboard
Debugger takes keyboard focus from active window
Description
Debugger takes keyboard focus from active window
Reproduction steps
Steps to reproduce the behavior:
- Open Notepad
- Click on "debug AHK script button" in vscode with the following script
caption := "Untitled"
WinActivate (caption)
WinWaitActive (caption, 10)
OutputDebug "done waiting"
Sleep 2000 ; wait for page to load and be ready for input
SendEvent "snafu"
Expected behavior
Expected:"snafu" is typed into the notepad window. Instead it is typed to the debugger expression eval window If I comment out
Sleep 2000 ; wait for page to load and be ready for input
then it behaves as expected. Using version 2.
Just a thought, if you create your script using a blank editor tab and then click the debug button, you are prompted to save the script - the default name will have "Untitled" in it, e.g. "Untitled-1.ahk".
I tried the above, and it sends "snafu" to the editor window unless you change the name of the script.
SendEvent "snafu"snafu
Fixed in a recent release, the debug output window used to capture focus by design but I changed that around 6.0.0