0

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?

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.

DavidNyan10
  • 163
  • 13

1 Answers1

0

Thank you /u/jcunews1 for helping me! 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.

DavidNyan10
  • 163
  • 13