Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Add layerDelayedLock capability #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xrigau
Copy link

@xrigau xrigau commented Aug 18, 2016

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:

  • Keyboard is in default layer 0.
  • User presses layerDelayedLock(1) key
    • If the user releases the 'delayed lock' key before 500 milliseconds, nothing happens, the current layer will still be layer 0.
    • If a new key is pressed before 500 milliseconds, the key press will still be from layer 0.
  • After 500 milliseconds have elapsed since the 'delayed lock' key was pressed then the keyboard locks to layer 1
    • The same behaviour applies to unlock the layer.

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant