[Proposal] Add layerDelayedLock capability #144
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.
This adds a capability to switch between layers that acts like a 'lock'
but with the difference that it requires the 'lock' key to be pressed
for 500 milliseconds before the function layer gets locked.
This is useful to avoid switching to a function layer by mistake since
pressing the lock key by accident won't actually switch layer unless
it's held for at least 500ms. (and yes an improvement would be to make those 500 milliseconds customizable).
So essentially:
This is a proposal, perhaps it's not the best way to implement it but I've been using it on a daily basis for about a month now and it works well for me. Feel free to close the PR if you don't think this feature fits well in the project.
Also note that I don't usually code in C/C++ so this can probably be improved by someone with more knowledge.