Skip to content

Commit

Permalink
add capslock_disable_exe_list & enable_middle_mouse_button_in_idea
Browse files Browse the repository at this point in the history
  • Loading branch information
no5ix committed Feb 23, 2022
1 parent b7b693c commit 84a6a03
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
11 changes: 10 additions & 1 deletion app_data/conf_bak/conf.no5ix.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,23 @@
}
}
},
"enable_middle_mouse_button_in_idea": 1,
"hotkey": {
"enable": 1,
"capslock_disable_exe_list": [
"WeChat.exe",
"MyPopo.exe"
],
"buildin": {
"capslock": "Esc",
"capslock_q": "ScreenShot",
"capslock_shift_q": "ScreenShotAndSuspend",
"ralt": "SwitchInputMethodAndDeleteLeft",
"capslock": "Esc",
"doublehit_rctrl": "SwapWinCtrlShiftAlt",
"win_c": "SwapWinCtrlShiftAlt",
"win_p": "SwapWinCtrlShiftAlt",
"win_z": "SwapWinCtrlShiftAlt",
"win_v": "SwapWinCtrlShiftAlt",
"capslock_c": "ctrl_/",
"capslock_e": "Enter",
"capslock_shift_e": "up",
Expand Down
28 changes: 23 additions & 5 deletions source/action.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,25 @@ SelectCurrentWord() {
}


;; 在 hotkey.capslock_disable_exe_list 里的软件内部会屏蔽单独敲击capslock键,
;; 避免如果capslock配成esc, 然后在微信里直接不小心按到了然后就关闭微信界面了的这种情况
CheckDisableCapslockList() {
if (SuxCore.GetSuxCfg("hotkey.buildin.capslock", 0) == 0) {
return 0
}
for _index, exe_name in SuxCore.GetSuxCfg("hotkey.capslock_disable_exe_list", []) {
if (WinActive("ahk_exe" exe_name)) {
return 1
}
}
return 0
}



CheckEnableMiddleMouseButtonInIdea() {
return SuxCore.GetSuxCfg("enable_middle_mouse_button_in_idea", 0) && WinActive("ahk_exe idea64.exe")
}


SUB_TEMP_RBUTTON:
Expand All @@ -412,18 +431,17 @@ LShift::LAlt
LAlt::LShift


#If WinActive("ahk_exe MyPopo.exe") or WinActive("ahk_exe WeChat.exe")
#If CheckDisableCapslockList()
; #If WinActive("ahk_exe MyPopo.exe") or WinActive("ahk_exe WeChat.exe")
; #IfWinActive ahk_exe MyPopo.exe
; #IfWinActive ahk_exe WeChat.exe

CapsLock::
return

Esc::
return


#IfWinActive ahk_exe idea64.exe
#If CheckEnableMiddleMouseButtonInIdea()
; #IfWinActive ahk_exe idea64.exe

MButton::
; MouseGetPos, StartVarX, StartVarY
Expand Down

0 comments on commit 84a6a03

Please sign in to comment.