Hello,
I Have code like this:
SetCapsLockState AlwaysOff
; Toggle Capslock with alt-Capslock.
!CapsLock::CapsLock
CapsLock & x::
If GetKeyState("Shift", "P")
Send, {BackSpace}
Else
Send, {Delete}
return
But it is not working ,in case of Caps Lock + Shift Condition.
Please Help for this code
Regards
CapsLock plus Shift
Re: CapsLock plus Shift
Hallo,
I don't know exactly what you want to do but there is a difference between the state of Capslock key and the CapslockState.
Try:
I don't know exactly what you want to do but there is a difference between the state of Capslock key and the CapslockState.
Try:
Code: Select all
#Persistent
SetTimer, KeyState, 200
!CapsLock:: ; Toggle CapslockState with alt-Capslock.
If GetKeyState("CapsLock", "T")
SetCapsLockState, Off
Else
SetCapsLockState, On
Return
KeyState: ;0/1 = Up/Down
MouseGetPos, TX, TY
ToolTip,%
( Join
` "Capslock key state: " GetKeyState("Capslock")
` "`nCapslockState: " GetKeyState("CapsLock", "T")
` "`nShift key state: " GetKeyState("Shift")
,TX+16,TY+32
)
Return
Re: CapsLock plus Shift
Hello,
Sorry for not clear.
I want Caps+Shift +x == Backspace
and
Caps+x == Delete
Also
Caps+Shift +d == Ctrl+Backspace
and
Caps+d== Ctrl+Delete
Regards
Sorry for not clear.
I want Caps+Shift +x == Backspace
and
Caps+x == Delete
Also
Caps+Shift +d == Ctrl+Backspace
and
Caps+d== Ctrl+Delete
Regards
Re: CapsLock plus Shift
Hallo,
if I press Caps + LShift + x at the same time, my autohotkey only notice Caps + LShift.
Try this script, maybe your hardware can do more.
But Caps + LShift + d works here!
Try:
if I press Caps + LShift + x at the same time, my autohotkey only notice Caps + LShift.
Try this script, maybe your hardware can do more.
Code: Select all
#Persistent
#InstallKeybdHook
#InstallMouseHook
SetTimer, KeyCombination, 100
KeyCombination:
ToolTip, % KeyCombination()
Return
KeyCombination(ExcludeKeys:="")
{
ExcludeKeys .= "{Shift}{Control}{Alt}{WheelUp}{WheelDown}"
Loop, 0xFF
{
Key := Format("VK{:02X}",0x100-A_Index)
IF !GetKeyState(Key,"P")
Continue
Key := "{" GetKeyName(Key) "}"
If !InStr(ExcludeKeys,Key)
KeyCombination .= Key
}
Return, KeyCombination
}
Return
Try:
Code: Select all
SetCapsLockState AlwaysOff
Capslock & d::
IF GetKeyState("Shift","P")
Send, ^{Bs}
Else
Send, ^{Del}
Return
Re: CapsLock plus Shift
Yes you are right.
Caps + LShift + x not working but Caps + LShift + d works OK.
Thanks for help.
Caps + LShift + x not working but Caps + LShift + d works OK.
Thanks for help.