AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Switch to make keystrokes produced by AHK trigger hotstrings

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Tue Mar 13, 2007 2:51 pm    Post subject: Switch to make keystrokes produced by AHK trigger hotstrings Reply with quote

Hi
I searched the forums and found no relevant info, so here is my whish/question about hotstrings:

In the help ( http://www.autohotkey.com/docs/Hotstrings.htm#AutoCorrect ), you can read:
Quote:
Hotstrings can never be triggered by keystrokes produced by any AutoHotkey script. This avoids the possibility of an infinite loop where hotstrings trigger each other over and over.

Which seems completely logical to me to avoid potential ill behavior.

As a result of this, when I check a script's "Key history and script info", I see that keystrokes produced by AHK fall into the "i" category in Type colum:
Quote:
i=Ignored because it was generated by an AHK script

However, I'd like to take into consideration a case in which adding an option to enable/disable this behavior would be beneficial in autoreplace/autocorrect scripts:

Assume that I have a huge number (+30) of different ways to trigger the word "identifizier":
Code:
:*:identifzier::identifizier
:*:identfizier::identifizier
:*:identifzier::identifizier
:*:identfizier::identifizier
:*:identifzeir::identifizier
:*:identfizeir::identifizier
:*:identifzeir::identifizier
:*:identfizeir::identifizier
:*:idntifzier::identifizier
:*:idntfizier::identifizier
:*:idntifzier::identifizier
:*:idntfizier::identifizier
:*:idntifzeir::identifizier
:*:idntfizeir::identifizier
:*:idntifzeir::identifizier
:*:idntfizeir::identifizier
:*:idnetifzier::identifizier
:*:idnetfizier::identifizier
:*:idnetifzier::identifizier
:*:idnetfizier::identifizier
:*:idnetifzeir::identifizier
:*:idnetfizeir::identifizier
:*:idnetifzeir::identifizier
:*:idnetfizeir::identifizier

Now, if the keystrokes send by AHK would NOT be ignored, I could just add the following line:
Code:
:*:identifizierne::identifizieren

(notice the "ne"->"en" ending)

With the result that when typing "identifzierne":
1) AHK would replace "identifzier" by "identifizier"
2) AHK would replace "identifizierne" by "identifizieren"
(that is, AHK would make a double replacement)

Without this option, the only way I see to handle this is to duplicate the +30 hotstrings above, so that's why I would find very convenient to add a hotstring switch to disable the default AHK behavior.

I understand that this is potentially dangerous as stated in the help, but AHK altogether can perform quite potentially dangerous actions, so it's the user responsibility to be aware of the consequences...

Any thoughts?
Back to top
View user's profile Send private message
Grumpy
Guest





PostPosted: Tue Mar 13, 2007 3:58 pm    Post subject: Reply with quote

I am not sure this is a right use of hotstrings...
This is indeed dangerous (locking the computer in infinite loop) and an error is easy to do... Now, AHK can check the number of recursive substitutions and break after a given number.
Lastly, there is a script for autocorrection. I don't know how it is made and if it applies to your case, but I though I should mention it.

I believe something smarter should be done, perhaps using Input and on word breaks, using soundex or similar algorithm (stuff like MySpell/Hunspell or Ispell/Aspell) to provide an correction (or a list of suggestions.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10474

PostPosted: Wed Mar 14, 2007 1:21 am    Post subject: Reply with quote

Something similar to this topic was proposed quite a while back. I agree that this option would be good to have, so it's definitely planned.

Thanks.
Back to top
View user's profile Send private message Send e-mail
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Wed Mar 14, 2007 1:39 pm    Post subject: Reply with quote

Chris wrote:
Something similar to this topic was proposed quite a while back. I agree that this option would be good to have, so it's definitely planned.
I did not find any reference in the forums (although it's quite difficult to decide what to search for)
Great to know it's planned! for those of us mantaining long autoreplace scripts, this can be absolutely useful to keep our list more manageable.
Thanks again!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group