diff --git a/app/spectrum.c b/app/spectrum.c index 8a466c354..43c2a4c4c 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -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; } @@ -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);