I've been trying to convert it to v2 (using a converter and then trying my best) but I'm still not able to get it fully working.
This is what I have so far:
Code: Select all
;=============================================================================================
; Left Alt + Caps Lock turns on Num Pad Mode
;=============================================================================================
; This script enables you to overlay a numpad on your tkl keyboard as shown below.
; |--------------------| |--------------------| ; |--------------------| |--------------------|
; | [7] [8] [9] [0] | ----> | [7] [8] [9] [/] | ; | [2] [3] [4] [5] | ----> | [9] [8] [7] [/] |
; | [u] [i] [o] [p] | ----> | [4] [5] [6] [*] | ; | [w] [e] [r] [t] | ----> | [6] [5] [4] [*] |
; | [j] [k] [l] [;] | ----> | [1] [2] [3] [-] | ; | [s] [d] [f] [g] | ----> | [3] [2] [1] [-] |
; | [m] [,] [.] [/] | ----> | [0] [0] [.] [+] | ; | [x] [c] [c] [b] | ----> | [0] [0] [.] [+] |
; |--------------------| |--------------------| ; |--------------------| |--------------------|
SetNumLockState True ;Turns on numlock when the script is first executed. With it off, you won't be able to input numbers.
nmsDisp(text, ms, icon_no ){
myGui := Gui()
myGui.Opt("+AlwaysOnTop +ToolWindow -SysMenu -Caption")
myGui.BackColor := "ffffff" ;changes background color
myGui.SetFont("c000000 s20 bold", "Verdana") ;changes font color, size and font
myGui.Add("Text", "x0 y0", text) ;the text to display
myGui.Title := "Xn: 0"
myGui.Show("NoActivate")
Sleep(ms)
myGui.Destroy()
TraySetIcon("Shell32",icon_no,"1")
}
<!Capslock:: ;If left alt and capslock is pressed. Will work even if other modifier keys are down.
{
static numPadMode :=false ; although the code runs with this line, I feel it's not right for it to be here.
if (numPadMode)
{
numPadMode := false
OutputDebug (numPadMode)
nmsDisp(" Numpad OFF", 200, 25 )
}
else
{
SetNumLockState("on") ;Turns on numlock when numPadMode is activated. With it off, you won't be able to input numbers.
numPadMode := true
OutputDebug (numPadMode)
nmsDisp(" Numpad ON", 200, 317 )
}
}
#HotIf (numPadMode) ; This is where the error is pointing at.
; numPadMode := True
{
j:: Send("{Numpad1}") ;When numPadMode is activated, the number row always sends numpad input.
k:: Send("{Numpad2}") ;
l:: Send("{Numpad3}") ;
u:: Send("{Numpad4}") ;
i:: Send("{Numpad5}") ;
o:: Send("{Numpad6}") ;
7:: Send("{Numpad7}") ;
8:: Send("{Numpad8}") ;
9:: Send("{Numpad9}")
,:: Send("{Numpad0}") ;
m:: Send("{Numpad0}") ;
p:: Send("{NumpadDiv}") ;
0:: Send("{NumpadMult}") ;
`;:: Send("{NumpadSub}") ;
/:: Send("{NumpadAdd}")
.:: Send("{NumpadDot}") ;
f:: Send("{Numpad1}") ;
d:: Send("{Numpad2}") ;
s:: Send("{Numpad3}") ;
r:: Send("{Numpad4}") ;
e:: Send("{Numpad5}") ;
w:: Send("{Numpad6}") ;
4:: Send("{Numpad7}") ;
3:: Send("{Numpad8}") ;
2:: Send("{Numpad9}") ;
v:: Send("{Numpad0}") ;
c:: Send("{Numpad0}") ;
q:: Send("{Backspace}") ;
5:: Send("{NumpadMult}") ;
t:: Send("{NumpadDiv}") ;
g:: Send("{NumpadAdd}") ;
b:: Send("{NumpadSub}") ;
a:: Send("{NumpadEnter}") ;
x:: Send("{NumpadDot}") ;
CapsLock:: Send("{Backspace}") ;
}
#Hotif
Code: Select all
Warning: This variable appears to never be assigned a value.
Specifically: local numPadMode
075: }
077: {
▶ 077: Return (numPadMode)
077: }
079: {
Thank you for looking into my issue.