I use thousands of AHK hotstrings. For example (simplified):
::btw::by the way
Unlike most AHK users, the only endkey I allow is \. So when I type btw\, I get by the way. Space or enter or other such keys do not set off the hotstrings. This ensures that hotstrings are never set off unintentionally.
Now, I also use chords. Here's a simplified version of one my chords:
~t & g::
~g & t::
SendInput {Backspace}
SendInput {Space}the{Space}
Return
The way these chords work is that if I press my finger on the border between the t and g keys, AHK types the (Including a space before and after.) Very useful.
Now, I'd like to take this up a notch: I want chords to automatically set off hotstrings. For example, say I want to type by the way the. I could type btw\ and then t and g together. But, it would be nicer if I could skip the backslash, and instead have the chord automatically set off the hotstring. (Only in the case where the text immediately before a chord is a hotstring, of course.)
Now obviously, I want this to work not only for this specific combination of btw and t+g, but for any combination of hotstring and chord from my vast collection.
How can I do that?
(One idea that came to mind is that AHK probably has a function that it launches every time you hit an endkey, which does something to the effect of "Look at the text that the user typed so far. Is it a hotstring? If so execute it." If only I had a way to invoke that function from inside my chord script, that would solve my problem. However, I have no idea how to do that.)
:*:btw::by the way- MCLqforquestion, and that would be out of the question. It will also make me unable to do hotstrings that contain each other likeil2andil2k. (Which areI'd like toandI'd like to know.) - Ram Rachum