Prevent hotstring from inputting actual text
Posted: 08 Jun 2018, 13:08
I have made some hotstrings to open certain folders by typing certain keys. For example, if I want to open a folder called AutoHotkey, I will type AHK and press spacebar or Enter. The hotstrings will only work if Scroll Lock is toggled. Here is the script:
The reason I chose this over a simple hotkey is that I have too many folders and use them quite often. I would soon run out of hotkeys to open each one. Besides, I find this method more intuitive, as not having to hunt for the folder I want with the mouse helps me keep focused.
Now what I would like to do is to prevent these hotstrings from actually editing text in a text editor, like Word or Trello. Like, if I'm in the middle of writing a document, I don't want to have to move the window out of focus just to type the hotstring without inserting "ahk " on the document itself, as that would defeat my purpose of being able to open the window I want imediately.
So, is there a way to achieve what I want? Maybe a way to make Scroll Lock disable actual text input while it's toggled, but allow hotstrings somehow?
Code: Select all
#If GetKeyState("Scrolllock","T")
::ahk::
Run, "C:\Users\Username\AutoHotkey"
Return
Now what I would like to do is to prevent these hotstrings from actually editing text in a text editor, like Word or Trello. Like, if I'm in the middle of writing a document, I don't want to have to move the window out of focus just to type the hotstring without inserting "ahk " on the document itself, as that would defeat my purpose of being able to open the window I want imediately.
So, is there a way to achieve what I want? Maybe a way to make Scroll Lock disable actual text input while it's toggled, but allow hotstrings somehow?