diff --git a/CapsLockHotkey.ahk b/CapsLockHotkey.ahk index d43b28d..1ab9056 100644 --- a/CapsLockHotkey.ahk +++ b/CapsLockHotkey.ahk @@ -77,9 +77,7 @@ Process Priority,,High start: ;-----------------START----------------- -global ctrlZ, CapsLock2, CapsLock, CapsLockOpen - -CapsLockOpen:=CLSets.Global.CapslockOpen!=""?CLSets.Global.CapslockOpen:true +global ctrlZ, CapsLock2, CapsLock Capslock:: ;ctrlZ: Capslock+Z undo / redo flag @@ -105,7 +103,7 @@ if CapsLock2 ; SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On" ; } ; ; sendinput, {esc} - if (!CapslockOpen) ; 为了大小写切换默认打开,取反 + if (CLSets.global.CapslockOpen) SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On" } CapsLock2:="" diff --git a/complete/CapsLockHotkey.exe b/complete/CapsLockHotkey.exe index 2170314..1cf9445 100644 Binary files a/complete/CapsLockHotkey.exe and b/complete/CapsLockHotkey.exe differ diff --git a/lib/lib_keysFunction.ahk b/lib/lib_keysFunction.ahk index 16ab881..cbd16fc 100644 --- a/lib/lib_keysFunction.ahk +++ b/lib/lib_keysFunction.ahk @@ -1022,23 +1022,20 @@ keyFunc_enterUpWherever(){ ; CapsLock大小写切换开关 keyFunc_capsLockOpen(){ - global - if(CapslockOpen) + if(CLSets.global.CapslockOpen) { ; 已开启,则关闭 SetCapsLockState, Off - CapslockOpen:=false - setSettings("Global","CapslockOpen",CapslockOpen) - showMsg("CapsLock On", 1000) ; 为了启动默认打开,if (!CapslockOpen)取反,提示信息取反 + setSettings("Global","CapslockOpen",0) + showMsg("CapsLock Off", 1000) } else { ; 已关闭,则打开 SetCapsLockState, On SetCapsLockState, Off - CapslockOpen:=true - setSettings("Global","CapslockOpen",CapslockOpen) - showMsg("CapsLock Off", 1000) ; 为了启动默认打开,if (!CapslockOpen)取反,提示信息取反 + setSettings("Global","CapslockOpen",1) + showMsg("CapsLock On", 1000) } return }