Skip to content

Commit

Permalink
Spectrum: decimal point deletion fix #148, slower buttons repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Nov 26, 2023
1 parent a0d052b commit 199b1a2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ static void UpdateFreqInput(KEY_Code_t key) {
}
if (key == KEY_EXIT) {
freqInputIndex--;
if(freqInputDotIndex==freqInputIndex)
freqInputDotIndex = 0;
} else {
freqInputArr[freqInputIndex++] = key;
}
Expand Down Expand Up @@ -996,17 +998,18 @@ bool HandleUserInput() {
kbd.prev = kbd.current;
kbd.current = GetKey();

if (kbd.current == KEY_INVALID) {
kbd.counter = 0;
return true;
}

if (kbd.current == kbd.prev && kbd.counter <= 16) {
kbd.counter++;
if (kbd.current != KEY_INVALID && kbd.current == kbd.prev) {
if(kbd.counter < 16)
kbd.counter++;
else
kbd.counter-=3;
SYSTEM_DelayMs(20);
}
else {
kbd.counter = 0;
}

if (kbd.counter == 3 || kbd.counter > 16) {
if (kbd.counter == 3 || kbd.counter == 16) {
switch (currentState) {
case SPECTRUM:
OnKeyDown(kbd.current);
Expand Down

0 comments on commit 199b1a2

Please sign in to comment.