cleaned up test on debounce

This commit is contained in:
asus
2024-02-01 17:40:20 +01:00
parent 8ff330b9d9
commit 50080e151a

View File

@@ -43,21 +43,6 @@ int should_ignore_keypress(const struct timeval *current_time, t_fdf *fdf)
last_milliseconds = (fdf->last_keypress_time.tv_sec % 1000) * 1000 + fdf->last_keypress_time.tv_usec / 1000;
is_less = (current_milliseconds - last_milliseconds) < DEBOUNCE_TIME;
/*
[1 705 151 587 ,905 277,49579540-1000000]
1 705 151 587 000
1 705 151 587 905
1 705 151 587 % 1000 = 587
587 * 1000 + 905 277 / 1000 = 587 000 + 905 = 587905
[836 763,836 066]
ft_putchar('[');
ft_putnbr(current_milliseconds);
ft_putchar(',');
ft_putnbr(last_milliseconds);
ft_putchar(']');
*/
if (!is_less)
fdf->last_keypress_time = *current_time;
return is_less;