Useful when writing an event handler that needs to check if a modifier is
active, but may run before OneShot has a chance to re-register the given
modifier.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
When another one-shot key is pressed, reset the timer, and handle it as if
starting anew, but without cancelling any previous one-shots. This allows one to
chain one-shots together.
Fixes#3.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The macro needs to check `.keyCode` and `.flags` separately, due to byte
ordering. If it does not, it will easily catch other things.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Cancel the one-shot state when the interruptor is pressed, not when it is
released. Otherwise, when typing fast, other keys pressed while the interruptor
is still releasing, may have the one-shot effect applied too.
For this to work, we need to do the cancellation post-clear, otherwise the
one-shot modifiers are cleared before they register with the interruptor.
Fixes#1, which used to be keyboardio/Akela#121.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>