From 5f10e5f86d5012e5a527327cf3d469d8c9e73c2c Mon Sep 17 00:00:00 2001 From: Alec Murphy Date: Wed, 9 Apr 2025 08:52:23 -0400 Subject: [PATCH] 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. :^) --- Applications/Accessories/Calculator.app/Run.HC | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Applications/Accessories/Calculator.app/Run.HC b/Applications/Accessories/Calculator.app/Run.HC index 2de14ec..f7022fd 100644 --- a/Applications/Accessories/Calculator.app/Run.HC +++ b/Applications/Accessories/Calculator.app/Run.HC @@ -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':