1.1.33.02 : Key not work if active window not responding

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
csphoenix1
Posts: 6
Joined: 16 Mar 2021, 08:17

1.1.33.02 : Key not work if active window not responding

Post by csphoenix1 » 16 Mar 2021, 08:20

Hi,

May I discover a problem.

If the active window is in a state like "Not responding" / hugging, no keys work.

Example : i wrote it in my AHK file :

Code: Select all

z::
Msgbox, hello
return
If I push the "z" key and if the active window is "Not responding", the message box never appear.
Whereas if the active window is not hangging, the message box appear.

This behavior is the same if I bind "z" key for send ALT+F4 for example : ALT+F4 never be sent.

Is there a way to allow the execution of the bind else if the active windows is in a "not responding" state ?

Thank you :)

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: 1.1.33.02 : Key not work if active window not responding

Post by mikeyww » 16 Mar 2021, 19:49

You can run the script at high priority, but it's no guarantee to work. In many cases, Windows Task Manager also hangs with non-responsive programs. You might be better off adjusting the Windows timeout for hung tasks. There is a windows process status called "not responding", so one could also attempt to kill such processes-- again, with no guarantee.

csphoenix1
Posts: 6
Joined: 16 Mar 2021, 08:17

Re: 1.1.33.02 : Key not work if active window not responding

Post by csphoenix1 » 18 Mar 2021, 16:54

Hi mikeyww, The priority change nothing. I think it's not a priority problem. It's just that when the active window is not responding, the keys seem to be not sent while the window is not responding. If I click on the another windows, the keys work well.

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: 1.1.33.02 : Key not work if active window not responding

Post by mikeyww » 18 Mar 2021, 17:00

That is not surprising. If a window is not responding, then.... it is not responding. :shifty:

I see your point: perhaps a non-responding window should not interfere with other things that a script is doing. I do find that when a program hangs, it can affect how well other programs are functioning, in ways that at least I cannot predict well. As noted, I think that the primary goal in such a situation would be to end the hung task.

csphoenix1
Posts: 6
Joined: 16 Mar 2021, 08:17

Re: 1.1.33.02 : Key not work if active window not responding

Post by csphoenix1 » 18 Mar 2021, 17:21

Hi mikeyww,

Thank for you answer.

I open the Window Spy, and the ahk_class is "Ghost", so "Ghost" seem to be equal to "Not responding".

My problem is sometimes I made some key combinations, and If the window hang/not responding/ghost during for example just a few millisecond, the combinations not work properly, and a "{Alt down}, Sleep 500, {Alt up}" can not work properly (I have sometimes the Alt key which is never be up) :(
So kill the window is not a solution because the window can hang just a few milliseconds or seconds.

So I would like AutoHotkey work in all time, else if the window is in Ghost or not.

csphoenix1
Posts: 6
Joined: 16 Mar 2021, 08:17

Re: 1.1.33.02 : Key not work if active window not responding

Post by csphoenix1 » 18 Mar 2021, 17:24

If fact, I would like AutoHotKey have a behavior like a keyword.

For example, when I push "Alt + Tab" on my keyword, it work well else if the window is not responding/ghost.

But If I made this code :

Code: Select all

z::
 Send !{Tab}
return
And I push "z", the Alt + Tab is never send during the windows is not responding. I have to wait until the windows became OK.

:(

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: 1.1.33.02 : Key not work if active window not responding

Post by mikeyww » 18 Mar 2021, 17:30

Yep, that's right. You do not have full control over the CPU.

Perhaps others have some clever workarounds here.

csphoenix1
Posts: 6
Joined: 16 Mar 2021, 08:17

Re: 1.1.33.02 : Key not work if active window not responding

Post by csphoenix1 » 20 Apr 2021, 17:03

Hello :)

Is there absolutely no solution?

When the active window is hunging, AHK is blocked and do nothing!... It's a real problem if for example i want to do an ALT+TAB with a shortcut via AHK.

In conclusion, AHK not work as a real keyboard. Unfortunaly it's bad.

How to solve it? :?

Thank in advance.

User avatar
boiler
Posts: 16960
Joined: 21 Dec 2014, 02:44

Re: 1.1.33.02 : Key not work if active window not responding

Post by boiler » 20 Apr 2021, 17:40

Another major flaw with AHK is that it stops working when the PC loses power. If anyone has a solution, please share it.

csphoenix1
Posts: 6
Joined: 16 Mar 2021, 08:17

Re: 1.1.33.02 : Key not work if active window not responding

Post by csphoenix1 » 19 Aug 2021, 11:39

The goal is to simulate a real keyboard.

And when a window is hugging, AHK have not the same behavior than a keyword.

@boiler
Just keep power on your computer. If you need other help, don't hesitate to post here.

Ciao.

Post Reply

Return to “Ask for Help (v1)”