Med
Med

Reputation: 267

AHK Across Script in Windows Holds Down the Button Even When Instructed to Release

I have a hotkey program in a different script that I am trying to trigger (#u::) and it seems to have a buggy behavior.

Script #1:

#MenuMaskKey vk07
#u::
msgbox,,test
return

Script # 2 that is trying to trigger the #u:: hotkey:

#SingleInstance
#NoEnv
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MenuMaskKey vk07
SendLevel, 10
Send, #{u} ; This successfully triggers the hotkey but now it holds down the # button

sleep, 1000
Send, {RWin Up} ;Here I am trying to release it but it still doesn't let it go

Btw, this occurs with all other modifiers, too like shift, alt, and control.

I am on the latest version (v1.1.26.01).

Upvotes: 0

Views: 166

Answers (1)

Relax
Relax

Reputation: 10543

Try this:

Script #1:

#InstallKeybdHook
#UseHook
#MenuMaskKey vk07

#u:: msgbox, test

Script # 2 that is trying to trigger the #u:: hotkey:

#SingleInstance
#NoEnv
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MenuMaskKey vk07

SendLevel 1
SendInput, {LWin down}u{LWin Up} 
If GetKeyState("LWin")
    Send {LWin Up} 
If GetKeyState("RWin")
    Send {RWin Up} 

Upvotes: 1

Related Questions