Skip to content

Commit

Permalink
添加大小写切换开关设置保存到配置文件。
Browse files Browse the repository at this point in the history
  • Loading branch information
zszq committed Aug 31, 2020
1 parent 1ce9fa2 commit 95b0b1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 2 additions & 4 deletions CapsLockHotkey.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:=""
Expand Down
Binary file modified complete/CapsLockHotkey.exe
Binary file not shown.
13 changes: 5 additions & 8 deletions lib/lib_keysFunction.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 95b0b1b

Please sign in to comment.