From: Ian Jackson Date: Wed, 30 Sep 2020 23:38:26 +0000 (+0100) Subject: wip keys X-Git-Tag: otter-0.2.0~808 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e5822d3c42e451375d8b91ae78a16a1ec4705e99;p=otter.git wip keys Signed-off-by: Ian Jackson --- 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 -----