From 0395bd667c8041a6cebfa1b0c4c8d34245a1d0ab Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 4 Apr 2021 00:19:07 +0100 Subject: [PATCH] js: Avoid duplicate handling of keystrokes We didn't notice that keys you type into input boxes (currently, just zoom) get fed to the play interpreter too, because you would only type digits there which are ignored. But we are about to pay attention to digits. Signed-off-by: Ian Jackson --- templates/script.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/script.ts b/templates/script.ts index 761e5ee6..a1aa33bf 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -387,6 +387,11 @@ function some_keydown(e: KeyboardEvent) { // my tsc says this isComposing thing doesn't exist. wat. if ((e as any).isComposing /* || e.keyCode === 229 */) return; if (e.ctrlKey || e.altKey || e.metaKey) return; + if (e.target) { + // someone else is dealing with it ? + let tag = (e.target as HTMLElement).tagName; + if (tag == 'INPUT') return; + } let pane = pane_keys[e.key]; if (pane) { -- 2.30.2