xiaofen9 / overkill

auto aiming
GNU General Public License v3.0
176 stars 67 forks source link

Changing activate key from CapsLock to another #13

Closed repte closed 7 years ago

repte commented 7 years ago

Hi, I am using your .ahk for some days now and it is awesome. Sadly for me it is hard to use with CapsLock pressed so I tried to do some changes which do not work. Can someone help me?

I found this in your code

GetKeyState, CapLck, CapsLock, P
if ( CapLck == "D" ) {
Cnt:=60
}

which if I am right checks if CapsLock is pressed down.

I would like to change that if I click CapsLock once its activated - when I press it again it deactivates.

My research found out, that the parameter P in GetKeyState, CapLck, CapsLock, P checks if CapsLock is physically clicked down at this moment. If this is true it gives back the D which is used to check in the if-statement below.

So I tried changing your code from

GetKeyState, CapLck, CapsLock, P
if ( CapLck == "D" ) {
Cnt:=60
}

to this

GetKeyState, CapLck, CapsLock, T
if ( CapLck == 1 ) {
Cnt:=60
}

If I read the GetKeySatet documentation right the parameter T checks if CapsLock is activated or not. If activated it gives back 1 for true; 0 for false.

Sadly my changes do not apply and it does not work. Any idead?

Thanks.

xiaofen9 commented 7 years ago

GetKeyState, CapLck, CapsLock, T it is the second parameter, CapsLock, that you should modify

repte commented 7 years ago

Thank you - this worked out!