From 4a086e4b9ab7b4dfc1f9af7d465214a449438ef4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 13 Jun 2022 01:44:33 +0100 Subject: [PATCH] script: Allow backspace to delete typed special count Signed-off-by: Ian Jackson --- templates/script.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/script.ts b/templates/script.ts index 2d2cb56f..09994c2f 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -500,6 +500,17 @@ function some_keydown(e: KeyboardEvent) { mousecursor_etc_reupdate(); return; } + if (e.key == 'Backspace') { + if (special_count == null) { + wresting = false; + } else if (special_count >= 10) { + special_count = Math.round(special_count / 10 - .45); + } else { + special_count = null; + } + mousecursor_etc_reupdate(); + return; + } let uo = uo_map[e.key]; if (uo === undefined || uo === null) return; -- 2.30.2