chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16e2809
)
script: Allow backspace to delete typed special count
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 13 Jun 2022 00:44:33 +0000
(
01:44
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 19 Jun 2022 09:23:24 +0000
(10:23 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts
patch
|
blob
|
history
diff --git
a/templates/script.ts
b/templates/script.ts
index 2d2cb56f1946d35028d8488ab253503b0a8f0d20..09994c2f491f322d603d28983621b03eb09fc269 100644
(file)
--- 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;