From 8ab1307b2b4cad8c0696e002fe101e84c455d896 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 23 Sep 2023 16:50:54 -0400 Subject: [PATCH] #344 include holding down keys for number fields --- graphics/elements/form/number_field.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/elements/form/number_field.lua b/graphics/elements/form/number_field.lua index 3c920b8..3e2d350 100644 --- a/graphics/elements/form/number_field.lua +++ b/graphics/elements/form/number_field.lua @@ -91,7 +91,7 @@ local function number_field(args) if e.value == 0 then e.value = "" end ifield.try_insert_char(event.name) end - elseif event.type == KEY_CLICK.DOWN then + elseif event.type == KEY_CLICK.DOWN or event.type == KEY_CLICK.HELD then if (event.key == keys.backspace or event.key == keys.delete) and (string.len(e.value) > 0) then ifield.backspace() has_decimal = string.find(e.value, "%.") ~= nil