Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger takes keyboard focus from active window #418

Closed
steveja42 opened this issue Jan 15, 2024 · 2 comments
Closed

Debugger takes keyboard focus from active window #418

steveja42 opened this issue Jan 15, 2024 · 2 comments
Assignees
Labels
bug something isn't working

Comments

@steveja42
Copy link

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 steveja42 added the bug something isn't working label Jan 15, 2024
@fade2gray
Copy link

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

@mark-wiemer mark-wiemer moved this to Todo in AHK++ Aug 18, 2024
@mark-wiemer
Copy link
Owner

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

image

@github-project-automation github-project-automation bot moved this from Todo to Done in AHK++ Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants