[英]How to detect if the user is naming/renaming a file/folder in AutoHotKey
I don't want hotkeys to fire up when this or this is happening.当这种情况发生时,我不希望热键启动。 How can I do that?
我怎样才能做到这一点?
Something I'm expecting:我期待的东西:
#IfWinActive ahk_exe Explorer.exe
.::
if(!namingfile){
run, "C:\Users\david\AppData\Local\Programs\Microsoft VS Code\bin\code"
}
return
#IfWinActive
How do I check for !namingfile
?如何检查
!namingfile
?
EDIT: I forgot to mention I also want it to ignore in the file address bar.编辑:我忘了提到我也希望它在文件地址栏中忽略。 I guess it should try to detect if I'm editing some text?
我想它应该尝试检测我是否正在编辑一些文本? I'm trying to achieve this question.
我正在努力解决这个问题。
Thank you /u/jcunews1 for helping me!谢谢/u/jcunews1 帮助我! Here's the answer:
这是答案:
#IfWinActive ahk_exe Explorer.exe
.::
if (focused == "Edit1") {
controlget hwndEdit, hwnd, , %focused%, a
hwndparent:= dllcall("GetParent", "ptr", hwndEdit, "ptr")
wingetclass parentclass, ahk_id %hwndparent%
isNotRenaming:= parentClass == "CtrlNotifySink"
} else isNotRenaming:= false
if (isNotRenaming) {
EnvGet LocalAppData, LOCALAPPDATA
Run % LocalAppData "\Programs\Microsoft VS Code\bin\code"
} else {
Send .
}
return
#IfWinActive
I tested it and it works very well like I described in the first question.我测试了它,它工作得很好,就像我在第一个问题中描述的那样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.