Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature Proposal:
Allows to pass several key codes that will be executed after one another. To do this, blocks of key codes are separated using
/
.To make the key codes more readable in the config, this also introduces white-space trimming, making it possible to give
29-20/46/46/12/30/32/50/23/49/28
as29-20 / 46 / 46 / 12 / 30 / 32 / 50 / 23 / 49 / 28
. A rewrite to using an array would be another option, but will break existing setups.The delays are configurable, defaulting to 100ms. If not enough delay values are given, the last one is repeated.
I am a bit unsure about the location of the array helpers – they might even be provided by go somewhere, I am not that proficient with it – as well the pad handling. It is possible to reduce the cases here down to "no entry" vs. "some entry", using the padding function in both cases, but this might be less clear.
Any comment on these issues, as well as regarding naming conventions or any other concern, is really appreciated.
As for the motivation: I use this code on my setup, e.g. to interface with the browser. Issue
Ctrl
+t
to open a new tab, wait until it is responsive (~150ms), then type some bookmark alias char by char with less delay between the events (20ms)Thanks for this tool 👍