Automatically refresh Inputhook's input collection according to the Length limit.

Propose new features and changes
Peter_Wang
Posts: 7
Joined: 01 Jun 2020, 12:22

Automatically refresh Inputhook's input collection according to the Length limit.

20 Jun 2020, 15:37

Now if I use

Code: Select all

ih := InputHook("L5")
The ih.input will collect five character and then stop.
I would like to know is there any chance of automatically dropping the oldest collection and recording the user's newest input when the input buffer meets the length limit.
This may need a new option for inputhook.
swagfag
Posts: 3976
Joined: 11 Jan 2017, 17:59

Re: Automatically refresh Inputhook's input collection according to the Length limit.

20 Jun 2020, 16:35

explaining what
automatically dropping the oldest collection and recording the user's newest input when the input buffer meets the length limit.
means

if the input buffer already contains abcde and u start typing 123, does the buffer now contain:
  • 123?
  • de123?
  • something else?
lexikos
Posts: 7067
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Automatically refresh Inputhook's input collection according to the Length limit.

21 Jun 2020, 00:19

The length limit instructs InputHook to stop collecting input when it reaches the limit. If you want newer input, you must not stop collecting input.

I'll consider an option for using the buffer in a circular manner (L5 giving you the most recent 5 characters), but you can already do whatever you want with the characters and keystrokes as they are typed; use L0 and OnChar.
Specifying L0 disables collection of text and the length limit, but does not affect which keys are counted as producing text (see VisibleText). This can be useful in combination with OnChar, OnKeyDown, KeyOpt or EndKeys.
Peter_Wang
Posts: 7
Joined: 01 Jun 2020, 12:22

Re: Automatically refresh Inputhook's input collection according to the Length limit.

21 Jun 2020, 11:30

swagfag wrote: explaining what "automatically dropping the oldest collection and recording the user's newest input when the input buffer meets the length limit."
means?
I apologize for my ambiguity. And what I mean is the second case that if the input buffer already contains abcde and u start typing 123the buffer would contain:de123.
lexikos wrote: I'll consider an option for using the buffer in a circular manner (L5 giving you the most recent 5 characters), but you can already do whatever you want with the characters and keystrokes as they are typed; use L0 and OnChar.
Thanks for the consideration. And as you said the L0option+OnChar property is enough to realize the function that enables the user to collect the most recent input (like A_priorkey). I post this feature request merely because I thought this is an "important and useful" feature exactly like A_priorkey which is profitable to prepare for the user so that one who may not familiar with the AHK language can easily get access to some very useful function and utilize them directly without paying too much time searching for the way to realize them.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 3 guests