I have an autohotkey script that treats (h,j,k,l) buttons like (left,down,up,right) when CAPSLOCK is pressed.
However, when I press caps and a button (h,j,k,l) too quickly it just outputs the letter.
Is there a way to reduce this "lag"? Could this be done easily in another language such as c or c++?
I'm also not sure what all of this code does, as part of it is clipped from the web.
#Persistent
#SingleInstance, Force
SetKeyDelay, -1
CoordMode, Tooltip, Screen
modal =
context =
num =
SetTimer, vim, 100
; Disable CAPSLOCK
$CAPSLOCK::
return
$+CAPSLOCK::
return
vim:
While GetKeyState("CAPSLOCK", "P")
{
vimize()
if modal !=
Tooltip, %context%: %num%, 60, 10
else if num !=
Tooltip, %num%, 60, 10
else
Tooltip
SetTimer, vim, off
}
modal =
num =
unvimize()
SetTimer, vim, on
Tooltip
Return
vimize()
{
Gui 11:Show, Minimize, vimOn ; Hide,
}
unvimize()
{
Gui 11:Destroy
}
#IFWinExist vimOn
h::Send, {Left}
j::Send, {Down}
k::Send, {Up}
l::Send, {Right}
; ===== SubRoutines =====
GetLineSelection:
Send, {Home}{Shift Down}{End}{DOWN %num%}{Home}{Shift Up}
Return
Run_Mode:
Send, ^%modal%
;Send {Left}{RIGHT}
num =
modal =
return