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:
parent
26f67901cc
commit
5f10e5f86d
1 changed files with 2 additions and 0 deletions
|
@ -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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue