Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Report problems with documented functionality
Qriist
Posts: 161
Joined: 11 Sep 2016, 04:02

Re: Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Post by Qriist » 11 Jan 2024, 12:48

lexikos wrote:
07 Jul 2023, 23:13
Ultimately, it doesn't seem worth the risk given that 64-bit AutoHotkey doesn't appear to be subject to removal of the hook.
On the Discord server @geek, @ShambleS1980, @luigislam and I spent a couple hours fruitlessly helping a user with what appears to be exactly this issue. It might be worth re-examining the x64 keyboard hook.


Aforementioned Discord thread: https://discord.com/channels/115993023636176902/1195022953516118106/1195022953516118106

lexikos
Posts: 9811
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Post by lexikos » 19 Jan 2024, 00:39

Qriist wrote:It might be worth re-examining the x64 keyboard hook.
Nothing has changed and no new information has come to light since I wrote that comment. I have reasons to believe that a perfect solution does not exist. The overall best solution is to not use 32-bit AutoHotkey.

m3user
Posts: 249
Joined: 17 Jan 2014, 18:11

Re: Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Post by m3user » 06 Dec 2024, 12:59

Hi, it seems that I have the same problem. I have prepared a simple script with many shortstrings and hotkeys for my colleagues and many of them report that the script stops working after some time. Based on the findings in this thread I replaced the script with a x64 version and it seems it works well - no stops anymore. The problem is that the script contains a Scintilla wrapper which doesn't work with x64 so I'm stuck with the x86 version.

Questions:
- Is it possible to solve it by avoiding some specific commands?
- If yes, how to determine the commands or parts of the script which may cause this so I can replace them with alternative code?
- Is there a list of the conflicting software which cause this?
- Any other suggestions?

User avatar
lmstearn
Posts: 736
Joined: 11 Aug 2016, 02:32
Contact:

Re: Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Post by lmstearn » 07 Dec 2024, 02:49

m3user wrote:
06 Dec 2024, 12:59
Hi, it seems that I have the same problem. I have prepared a simple script with many shortstrings and hotkeys for my colleagues and many of them report that the script stops working after some time. Based on the findings in this thread I replaced the script with a x64 version and it seems it works well - no stops anymore. The problem is that the script contains a Scintilla wrapper which doesn't work with x64 so I'm stuck with the x86 version.
Hi m3user, for a specific script, this might be better in a separate discussion thread. Just to be sure, "the script stops working after some time" is the same as some hotkeys not working after some time?
- Is it possible to solve it by avoiding some specific commands?
Worth a shot, the obvious way to narrow them down is by ... log analysis. Write to log all keyboard events from the user run scripts before they stop working. Logs could be large, see an old thread here, and RT History per Lexikos.
- If yes, how to determine the commands or parts of the script which may cause this so I can replace them with alternative code?
It might be better to use a 64 bit SciTe4 wrapper in any case, like Scintilla Complete for example, another option is to convert the wrapper to 64 bit, is it in LUA or something else?
- Is there a list of the conflicting software which cause this?
...
Who knows, by the sound of it's more like an internal Windows thing, or a driver issue in user mode, a common occurrence for "not responding" is a previous key-up event not registered in the system, there's also the hooks issue discussed on the previous page. These ephemeral bugs are not easy to pin down, if it isn't the key events, something else might be off in the WOW64 subsystem or directory, so consider things like Wow64DisableWow64FsRedirection for the 32 bit calls as a workaround instead.
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH

m3user
Posts: 249
Joined: 17 Jan 2014, 18:11

Re: Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Post by m3user » 07 Dec 2024, 06:13

Thanks for your kind response. I'll try to test it further but I believe the whole script stops (all hotkeys and hotstrings). Thanks for the tip on Scintilla. Unfortunately I'm still on Ahk v1 as the conversion would be too complex.

m3user
Posts: 249
Joined: 17 Jan 2014, 18:11

Re: Hotkeys stop working after some time with 32-bit AHK on 64bit OS

Post by m3user » 08 Dec 2024, 04:51

May I also ask - is the "script stopping" issue described in this thread primarily caused by using conditional #if hotkeys? Would eliminating all #if commands resolve the issue? Thanks.

Post Reply

Return to “Bug Reports”