How to get characters typed in last hotstring? Topic is solved
-
- Posts: 61
- Joined: 25 Jan 2016, 14:26
How to get characters typed in last hotstring?
I am a heavy user of hotstrings, and one thing that would be useful to me is know what characters I typed that were auto-deleted and then expanded. I know that the variable A_PriorHotkey will contain the name of the last hotkey I typed, e.g., ::btw::, but if I for example typed "BTW", that variable will not capture that I typed all uppercase letters.
I don’t see that what I want is available in the hotstring function, but I figured I’d ask in case I’m missing something.
I don’t see that what I want is available in the hotstring function, but I figured I’d ask in case I’m missing something.
Re: How to get characters typed in last hotstring? Topic is solved
Code: Select all
:C:btw::
:C:BTW::
keys := RegExReplace(A_ThisHotkey, "^:.*?:")
MsgBox, %keys%
Return
-
- Posts: 61
- Joined: 25 Jan 2016, 14:26
Re: How to get characters typed in last hotstring?
Thank you for the reply. I am most interested in somehow duplicating a functionality in PhraseExpress where, after completing a word, you can backspace back into the completed word and edit it without triggering another hotstring when you next press space. Say I have the following hotstrings defined:
If I were to type "app" and press space, then press backspace and type "e" and then space, it would be cool if it expanded into "apple" instead of "early." I often have these unwanted expansions in my day to day typing. But I refuse to continue using PhraseExpress; it’s impossible to export your data in a usable fashion.
Code: Select all
::e::early
:appe::apple
Re: How to get characters typed in last hotstring?
It already does that, but you need a valid script.
Explained: Hotstrings
Code: Select all
::e::early
::appe::apple
To define a hotstring, enclose the triggering abbreviation between pairs of colons.
-
- Posts: 61
- Joined: 25 Jan 2016, 14:26
Re: How to get characters typed in last hotstring?
You’re right, I gave a bad example. Here is what I meant to illustrate:
Now if I follow the steps I outlined above, I will get the unwanted behavior I described, where I get an expansion of the ::e:: hotstring when I was actually trying to expand ::appe::. This is because the middle expansion, ::app::, already cleared the hotstring recognizer when it expanded following a space ending character.
Code: Select all
::e::early
::app::app
::appe::apple
Re: How to get characters typed in last hotstring?
Why would you have the following hotstring?
Code: Select all
::app::app
-
- Posts: 61
- Joined: 25 Jan 2016, 14:26
Re: How to get characters typed in last hotstring?
I certainly wouldn’t, but I have had this experience with hotstrings that I do logically use.
Re: How to get characters typed in last hotstring?
An example would be useful.