![]() ![]() New LongHotkey("~t&e&f","exe_textify","hhh") Here is a example: #Include longhotkey.ahk Sleep 500 give just a bit of time for Chrome to respond Send ^l this is the shortcut for focusing on the address bar Send ^t To you know - open a new window :) Sleep 50 give just a bit of time for Chrome to respond SetTimer, Off Make sure we turn back off the timer - otherwise it'll keep calling CheckOff every 2 seconds. SetTimer, CheckOff, 2000 2 seconds to type in second part of shortcut ![]() I use it for shortcuts to various sites: f8:: ![]() More about that from the documentation.īasically, just try it out and if you have problems, maybe consider another approach. If your script is just about simple hotkeys or something like that, this is a very good approach.īut if your script is more complex than that, you might run into the problems #If can cause. Whether or not I'd recommend this approach is another thing. #If, GetKeyState("Ctrl") & GetKeyState("1") & GetKeyState("2") & GetKeyState("3") & GetKeyState("4") & GetKeyState("5") is only going to work if your system can #If, GetKeyState("Ctrl") start of context sensitive hotkeys In your case you'd want to check if the first key(s) of your hotkey is/are held down.Īnd then you'd set the last keys as a hotkey. You create a context sensitive hotkey by setting whatever condition with the #If directive. KeyWaiting is showed in the other answer, I'd like to show the other option, which is using #If and GetKeyState(). ![]()
0 Comments
Leave a Reply. |