I've tried to search the documentation, forums, and web, and have seen the following posts:
https://gist.github.com/ravikumarjain/26e6551a6a67a629aa75
http://www.autohotkey.com/board/topic/58483-how-to-access-the-hotstring-recognizer/
https://superuser.com/questions/936306/tooltip-should-appear-after-typing-two-letters-of-the-hotstrings/
From what I understand, those scripts use a loop to get the typed input, essentially creating their own stored string of what the recognizer might already have stored somewhere. I have also thought about trying to recreate what the hotstring recognizer is tracking. But I'd like to know if there is already an internal variable (e.g. A_Variable) that already has the recognizer content stored.
A section of my script currently is shown below, which displays the key I just typed with a tooltip, and also resets the recognizer after 3 seconds. And as an aside, I'm using a Map object to establish the hotkeys for other reasons in the script.
Thanks in advance for any help!
Code: Select all
global MapKeyDefs := Map() ; define an object with hotstring abbreviations and replacements
MapKeyDefs["btw"] := Map("replacement", "by the way")
MapKeyDefs["omy"] := Map("replacement", "on my way")
for MapKeyItem, MapKeyParams in MapKeyDefs
{
Hotstring ":c1ZSI*:" . MapKeyItem, SWSearchKey MapKeyDefs[MapKeyItem]["replacement"] ; create hotstrings for every item in MapKeyDefs
}
~$b::
~$t::
~$w::
{
ToolTip substr(A_ThisHotkey,StrLen(A_ThisHotkey)) ; send tooltip of the hotkey without the "~$"
SetTimer hidetip, -3000 ; hide tip after 3 seconds, do it just once
}
hidetip() {
tooltip ;close the tooltip
Hotstring "Reset"
}
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]