mirror of
https://git.checksum.fail/alec/erythros
synced 2025-12-11 13:39:55 +02:00
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:
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user