chiark / gitweb /
wip keys
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 30 Sep 2020 23:38:26 +0000 (00:38 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 30 Sep 2020 23:38:40 +0000 (00:38 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index 441822ed863f1d39dd53104babbc81657d92aff5..35b9b44bc560ae7d906ff7c02203368b6144de8c 100644 (file)
@@ -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 -----