I have something working... almost....
Code:
;******************* CapsLock and NumLock experiement number 2 ********************
CLstate := GetKeyState("Capslock", "T")
NLstate := GetKeyState("NumLock", "T")
~CapsLock:: CLstate := GetKeyState("Capslock", "T") ; True if CapsLock is ON, false otherwise.
~NumLock:: NLstate := GetKeyState("NumLock", "T") ; add the NumLock status; CapsLock navigation
; Implement some sort of hotkey trap based on the state of the caps and nums both 0
; in that situation the hotkey is not a hotkey.
$z::
loop
{
if ((CLstate = 0) & (NLstate = 0)) ; Send normal key function if both off
{
Send {~z} ; How do I get this to pass without triggering the hotkey again.
MsgBox, 4, ,CAPS %CLstate% + NL %NLstate%, 1
break
}
else if ((CLstate = 1) & (NLstate =0)) ; 2 caps only
{
Send {2}
MsgBox, 4, ,CAPS %CLstate% + NL %NLstate%, 1
break
}
else if ((CLstate = 0) & (NLstate = 1)) ; 3 numlock is only
{
Send {3}
MsgBox, 4, ,CAPS %CLstate% + NL %NLstate%, 1
break
}
else if ((CLstate = 1) & (NLstate = 1)) ; 4 both off
{
Send {4}
MsgBox, 4, ,CAPS %CLstate% + NL %NLstate%, 1
return
}
}
return
I suppose I could make some sort of if then before the hotkey, hmm.....
Please consider and advise.
Thanks!
_________________
KeyMce/GenMce - mackie emulator for pc keyboard/Convert your controller to mackie.
Midi I/O - Want to play with midi/ahk?