ahkpp icon indicating copy to clipboard operation
ahkpp copied to clipboard

Debugger takes keyboard focus from active window

Open steveja42 opened this issue 1 year ago • 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.

steveja42 avatar Jan 15 '24 20:01 steveja42

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

fade2gray avatar Feb 09 '24 20:02 fade2gray

Fixed in a recent release, the debug output window used to capture focus by design but I changed that around 6.0.0

image

mark-wiemer avatar Oct 17 '24 14:10 mark-wiemer