Friday, May 31, 2019

autohotkey help-#inputlevel but not overwrite key combination?

[help] #inputlevel but not overwrite key combination ?


i have 2 ahk script ,both remap "k" ,but script 1 has "scrolllock & k"


script1.ahk


k::msgbox script1
scrolllock & k::click

script2.ahk


k::msgbox script2

i want this : when running both script at the same time , if i press k ,
it will execute the script2.ahk (which show "msgbox script2" ) ,


in other way, script2 overwrite script1


so i put #inputlevel2 in script2.ahk


it now looks like this


script1.ahk


k::msgbox script1
scrolllock & k::click

script2.ahk


#inputlevel2
k::msgbox script2

but now if i press "scrolllock & k" , it will not do the click (function of script1)
but it show msgbox (script2)
i guess because "k" has been overwrited by script2
and "scrolllock & k" no longer be recognized


i found a way to make scrolllock & k work, when i reload script1 ,and press scrolllock & k ,it will work


but if i reload script2 , i will have to reload script1 again to make that key combination work


In other way, my question is
Is it possible to overwrite "k" of script2 to "k" of script1 but still do function like "scrolllock & k" of script1 ?


Thanks

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...