From e5822d3c42e451375d8b91ae78a16a1ec4705e99 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 1 Oct 2020 00:38:26 +0100 Subject: [PATCH] wip keys Signed-off-by: Ian Jackson --- templates/script.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index 441822ed..35b9b44b 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -47,7 +47,7 @@ type Pos = [number, number]; type ClientSeq = number; type Generation = number; type UoKind = "Global"| "Piece" | "ClientExtra" | "GlobalExtra"; -type WhatResponseToClientOp = "Predictable" | "Unpredictable" | "UpdateSVG"; +type WhatResponseToClientOp = "Predictable" | "Unpredictable" | "UpdateSvg"; type UoDescription = { kind: UoKind; @@ -270,9 +270,15 @@ function some_keydown(e: KeyboardEvent) { if ((e as any).isComposing /* || e.keyCode === 229 */) return; let uo = uo_map[e.key]; - if (uo === undefined) return; + if (uo === undefined || uo === null) return; console.log('KEY UO', e, uo); + if (uo.targets === null) { + return; + } + if (uo.wrc! == 'UpdateSvg' || uo.wrc! == 'Predictable') { + + } } // ----- clicking/dragging pieces ----- -- 2.30.2