From: Ian Jackson Date: Tue, 13 Apr 2021 22:41:22 +0000 (+0100) Subject: js: Properly handle shift-click deselection X-Git-Tag: otter-0.5.0~89 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c6f932691d386eba7325d1f96417b59e7a6019ee;p=otter.git js: Properly handle shift-click deselection Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index fd309091..60b07c41 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -987,6 +987,13 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { drag_pieces = []; if (held == us) { + if (shifted) { + for (let tpiece of clicked) { + let tp = pieces[tpiece]!; + do_ungrab(tpiece,tp); + } + return; + } dragging = DRAGGING.MAYBE_UNGRAB; // contrive to have these first for (let piece of clicked) {