Bug that was driving me insane for a week was actually a bug with AHK itself

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
User avatar
NovaChromatic
Posts: 22
Joined: 21 Dec 2021, 09:28
Contact:

Bug that was driving me insane for a week was actually a bug with AHK itself

Post by NovaChromatic » 01 Feb 2024, 19:28

So back in August last year, I was driving myself insane for a week trying to fix a bug. I planned on asking for help here, even drafted a long-ass explanation with a crap-ton of comments, but never got around to posting it.

Jump to now where I'm revisiting the code and it's actually working – no more bug? Then I come to find out it was actually a bug with AHK itself that was fixed in v2.0.7, less than a month after I initially encountered the bug.

I feel both validated and annoyed that I never posted it, lol.

Here's an example of the bug (easy to see the simplified version in hindsight):

Code: Select all

0:: Shift
; You should be able to trigger the below hotkey by pressing 0 & 1,
; but in v2.0.6 and below, you can't.
$+1:: MsgBox()
The specific fix found in the v2.0.7 notes is "Fixed hook hotkeys not recognizing modifiers which are pressed down by SendInput."

Really just posting this for catharsis.


User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: Bug that was driving me insane for a week was actually a bug with AHK itself

Post by flyingDman » 14 Feb 2024, 13:56

That "0 & 1" script works but it disables the 0 key.
I am always surprised when people are attempting to make odd key combinations work. There are literally hundreds of viable keyboard combinations available using the "normal" modifiers. Why complicate your life?
14.3 & 1.3.7

RussF
Posts: 1269
Joined: 05 Aug 2021, 06:36

Re: Bug that was driving me insane for a week was actually a bug with AHK itself

Post by RussF » 14 Feb 2024, 15:29

flyingDman wrote:
14 Feb 2024, 13:56
That "0 & 1" script works but it disables the 0 key.
I am always surprised when people are attempting to make odd key combinations work. There are literally hundreds of viable keyboard combinations available using the "normal" modifiers. Why complicate your life?
+1

Then there's,"I want my shift key to do 'this' on a short press, 'that' on a medium press, 'the other thing' on a long press, but I want it to do 'something else' on a double-press and 'one more thing' on a triple-press. Please write the script for me." :roll:

Russ

User avatar
NovaChromatic
Posts: 22
Joined: 21 Dec 2021, 09:28
Contact:

Re: Bug that was driving me insane for a week was actually a bug with AHK itself

Post by NovaChromatic » 02 Apr 2024, 22:02

flyingDman wrote:
14 Feb 2024, 13:56
That "0 & 1" script works but it disables the 0 key.
The code I gave was an abstraction, but the goal was to remap a non-modifier key to a modifier. To be specific, I wanted to map CapsLock+S to Shift. But yes, I've realized since then that using the native modifiers is simpler to code and simpler for the brain to remember.

Post Reply

Return to “General Discussion”