Applications/Accessories/Calculator: Debounce numerical input

The Calculator isn't functional yet, but when it eventually does work,
it will be helpful to not duplicate every number keypress when the
result input widget is focused. :^)
This commit is contained in:
Alec Murphy 2025-04-09 08:52:23 -04:00
parent 26f67901cc
commit 5f10e5f86d

View file

@ -24,6 +24,8 @@ U0 @calc_keypress_callback(Window*, I64 key)
{
if (win != Compositor.active_win)
return;
if (win->focused_widget == result)
return;
U8* res_text = result->text;
switch (ScanCode2Char(key)) {
case '0' ... '9':