AutoHotkey Community

It is currently May 26th, 2012, 1:00 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: May 10th, 2005, 2:45 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
As it came up in the Scripts forum http://www.autohotkey.com/forum/viewtopic.php?t=3486 it would be nice to have an option (E) for the Input command that makes the EndKeys invisible, even if the input keys are visible to the foreground application. It helps when a HotString-like dynamic text replacement is performed. When the EndKey is Enter or TAB they usually cause complex results in applications, and to find and delete the matched input becomes impossible. If the script saves the EndKey in a variable it could be sent to the application after the text replacement has been processed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2005, 9:49 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks. I've made a note to assess the difficulty of this. If it turns out to be easy, hopefully it will be done sometime in the next week or two.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 6th, 2005, 2:11 pm 
Offline

Joined: June 1st, 2005, 11:09 am
Posts: 54
Location: Scotland
This would also be useful for my script that assigns one special key followed by any keyboard key to produce many alternate characters or macro strings... accept and read and analyse any single keystroke into the running script. But Input with key limit and time-out gave me all but the invisible keys - thanks for the tip there. The Fitaly keyboard has a shortage of the invisible keys anyway - that was one reason for the script!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2005, 4:07 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
A related question: if no endkey is pressed for a long time (e.g. playing a game with letter key navigation), does the buffer of the input command grow indefinitely? If finally an endkey is pressed, the returned variable could be huge. I have not tried it, but I assume it slows down everything. It would be, therefore, also nice to have a rolling length limit for the input command: only the last, say 10 keystrokes are kept and returned. Of course, it only makes sense if the keystrokes are visible. In the referenced thread there is a workaround, storing each keystroke explicitly in a ring buffer, but with the rolling-length limit and the invisible endkey it would take just one AHK instruction.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2005, 6:10 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Laszlo wrote:
A related question: if no endkey is pressed for a long time (e.g. playing a game with letter key navigation), does the buffer of the input command grow indefinitely?
It already limits the text by means of the L option. If you omit the L option, the buffer size is automatically set to 16383.

Due to the way the buffer is filled (simple append), there should be no slow-downs even when it gets large. The one possible exception is when you specify the * option along with a very long MatchList.

Edit: Input does not use a "ring buffer".


Last edited by Chris on June 7th, 2005, 1:51 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2005, 6:33 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Chris, the help says
Quote:
L: Length limit (e.g. L5). The maximum allowed length of the input. When the text reaches this length, the input will be terminated and ErrorLevel will be set to the word Max unless the text matches one of the MatchList phrases, in which case ErrorLevel is set to the word Match. If unspecified, the length limit is 16383, which is also the absolute maximum.
This does not indicate a ring buffer. If the input command returns with Max, and we restart it, a possible match can be cut into two halves, and it won’t be found.

Also, according to the help text, if I press 16K keys the input command will terminate. If there is really a ring buffer, the help needs clarifications.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2005, 1:49 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Laszlo wrote:
[The help file] does not indicate a ring buffer.
My mistake. Input does not use a ring buffer (I was thinking of hotstrings, which do).

Quote:
If the input command returns with Max, and we restart it, a possible match can be cut into two halves, and it won’t be found.
The script should ensure that the 16,383 limit is never reached. I think this can be done in all but extreme/hypothetical cases by choosing one or more ending characters that occur reasonably often, such as Space or Enter.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2005, 1:38 pm 
Chris wrote:
[quote="Laszlo]If the input command returns with Max, and we restart it, a possible match can be cut into two halves, and it won’t be found.
The script should ensure that the 16,383 limit is never reached. I think this can be done in all but extreme/hypothetical cases by choosing one or more ending characters that occur reasonably often, such as Space or Enter.[/quote]Alternatively, test in Input1 for "Lasz" and in Input2 for "zlo". If found, investigate further. If not, do not.

A_KeyHistory would be more versatile. However, on reflection, we might need A_KeyHistoryRaw and A_KeyHistoryCooked, to trap "Lass{Backspace}zlo" also. We'd need to reset KeyHistory to empty (at least the local copy)... and the Lasz/zlo question doesn't necessarily go away. Never mind. Just give us the tool anyway so we can start to blame it for our own shortcomings :-)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2005, 11:03 pm 
Offline

Joined: June 1st, 2005, 11:09 am
Posts: 54
Location: Scotland
Anonymous wrote:
Chris wrote:
Laszlo wrote:
If the input command returns with Max, and we restart it, a possible match can be cut into two halves, and it won’t be found.

The script should ensure that the 16,383 limit is never reached. I think this can be done in all but extreme/hypothetical cases by choosing one or more ending characters that occur reasonably often, such as Space or Enter.

Alternatively, test in Input1 for "Lasz" and in Input2 for "zlo". If found, investigate further. If not, do not.

A_KeyHistory would be more versatile. However, on reflection, we might need A_KeyHistoryRaw and A_KeyHistoryCooked, to trap "Lass{Backspace}zlo" also. We'd need to reset KeyHistory to empty (at least the local copy)... and the Lasz/zlo question doesn't necessarily go away. Never mind. Just give us the tool anyway so we can start to blame it for our own shortcomings :-)


Me again by the way.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group