actionKeys: Improved overflow handling

When tapping a tap-dance key handled by `TapDance::actionKeys` more times than
the amount of keys available, treat it as if the last action was to be
triggered. This feels not only more intuitive, but it also allows the counter
and state to reset as soon as possible, resulting in a better typing experience.

Fixes #1.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 27e4b80e1f
commit 3dc12f29e3

@ -108,7 +108,7 @@ namespace Akela {
void
TapDance::actionKeys (uint8_t tapCount, ActionType tapDanceAction, uint8_t maxKeys, const Key tapKeys[]) {
if (tapCount > maxKeys)
return;
tapCount = maxKeys;
Key key;
key.raw = pgm_read_word (&(tapKeys[tapCount - 1].raw));

Loading…
Cancel
Save