mark-wiemer-org/ahkpp

Debugger takes keyboard focus from active window

Opened this issue · 1 comments

Description

Debugger takes keyboard focus from active window

Reproduction steps

Steps to reproduce the behavior:

  1. Open Notepad
  2. 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