Clear the previous key when a new one is pressed

When we light up a new key, clear the previous one (but only if it isn't the
same, to avoid flickering).

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/365/head
Gergely Nagy 8 years ago committed by Gergely Nagy
parent 49720378bd
commit 91380a81c8

@ -57,16 +57,20 @@ namespace KaleidoscopePlugins {
return key;
uint8_t displayCol = 2;
Key prevKey = lastKeyLeft;
if (col < COLS / 2) {
lastKeyLeft = key;
endTimeLeft = millis () + length;
} else {
prevKey = lastKeyRight;
lastKeyRight = key;
endTimeRight = millis () + length;
displayCol = 10;
}
if (prevKey != key)
::AlphaSquare.clear (prevKey, displayCol);
::AlphaSquare.display (key, displayCol);
return key;
}

Loading…
Cancel
Save