1.1.33.10: Win+Alt sticking in Windows 10

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AKazak
Posts: 6
Joined: 15 Mar 2018, 10:08

1.1.33.10: Win+Alt sticking in Windows 10

25 Apr 2022, 03:24

[Moderator's note: Topic moved from Bug Reports.]

Greetings!

I use AHK 1.1.33.10 Unicode x64 under Microsoft Windows [Version 10.0.17763.2565] with the following script:

Code: Select all

; - Insert Date Time stamp
!#d::
  FormatTime, xx,, yyyy-MM-dd ; This is one type of the date format
  SendInput, %xx%.{Space}
Return
In about 90% of cases Win+Alt+D triggers the script correctly, but in the end leaves Win or/and Alt keys stuck (pressed).

Can you suggest a way to overcome the issue?

Thank you.
lexikos
Posts: 9665
Joined: 30 Sep 2013, 04:07
Contact:

Re: 1.1.33.10: Win+Alt sticking in Windows 10

25 Apr 2022, 22:15

First, try $!#d::

This is unlikely to be a bug. Keyboard automation on Windows is inherently error-prone. This is why there are so many options (send modes, key delays, hotkey modifiers, directives...).
AKazak
Posts: 6
Joined: 15 Mar 2018, 10:08

Re: 1.1.33.10: Win+Alt sticking in Windows 10

26 Apr 2022, 02:13

Thank you for the suggestion.
Currently I'm testing $!#d:: and it showed no glitches so far.
What is the difference between !#d:: and $!#d::?
lexikos
Posts: 9665
Joined: 30 Sep 2013, 04:07
Contact:

Re: 1.1.33.10: Win+Alt sticking in Windows 10

26 Apr 2022, 03:41

The $ prefix forces the keyboard hook to be used to implement this hotkey
Source: Hotkeys - Definition & Usage | AutoHotkey
Reducing the #HotkeyModifierTimeout would likely be an alternative, less reliable solution. The documentation for it explains why $ supersedes it.
AKazak
Posts: 6
Joined: 15 Mar 2018, 10:08

Re: 1.1.33.10: Win+Alt sticking in Windows 10

26 Apr 2022, 03:56

Thank you for commenting this.
AKazak
Posts: 6
Joined: 15 Mar 2018, 10:08

Re: 1.1.33.10: Win+Alt sticking in Windows 10

29 Apr 2022, 00:31

AKazak wrote:
26 Apr 2022, 02:13
Thank you for the suggestion.
Currently I'm testing $!#d:: and it showed no glitches so far.
Few days of testing showed that $!#d:: does not fix the issue.
What else can I tweak?
lexikos
Posts: 9665
Joined: 30 Sep 2013, 04:07
Contact:

Re: 1.1.33.10: Win+Alt sticking in Windows 10

29 Apr 2022, 22:47

Your code does not produce any problems on my system.

You can try the {Text} modifier or other send modes.

If you have other scripts or programs running that use a keyboard hook, that may impact the behaviour (as described in the documentation for SendInput), although it doesn't change the result in my case.
AKazak
Posts: 6
Joined: 15 Mar 2018, 10:08

Re: 1.1.33.10: Win+Alt sticking in Windows 10

30 Apr 2022, 09:49

lexikos wrote:
29 Apr 2022, 22:47
If you have other scripts or programs running that use a keyboard hook, that may impact the behaviour (as described in the documentation for SendInput), although it doesn't change the result in my case.
I suspect one software in my system item that is also tracking keyboard input and does smart replacement while typing.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: songdg and 84 guests