Code: Select all
GetKeyState, state, Numlock, T ; if Numlock is on, pressing "a" makes an "x" and else pressing "a" makes a "c"
state := GetKeyState ("Numlock", "T")
if state = D {
a:: x
}else{
a:: c
}
Return
Code: Select all
GetKeyState, state, Numlock, T ; if Numlock is on, pressing "a" makes an "x" and else pressing "a" makes a "c"
state := GetKeyState ("Numlock", "T")
if state = D {
a:: x
}else{
a:: c
}
Return
Code: Select all
; if Numlock is on, pressing "a" makes an "x" and else pressing "a" makes a "c"
a::
If GetKeyState("Numlock", "T")
Send, x
Else
Send, c
Return
Have you tested with Notepad or any text editor? For me, there is no inconsistency there.l ryux wrote:It is very incosistent when numlock is toggled, it would sometimes put out "x", but sometimes "x" and "c" at once.
Code: Select all
#If GetKeyState("NumLock","T")
$a::x
#If
#if !GetKeyState("NumLock","T")
$a::c
#If
seems to work for meYoucefHam wrote:try thisCode: Select all
#If GetKeyState("NumLock","T") $a::x #If #if !GetKeyState("NumLock","T") $a::c #If