});
}
-function drag_mousedown(e : MouseEvent) {
+function some_mousedown(e : MouseEvent) {
console.log('mousedown', e);
+
+ if (e.button != 0) { return }
+ if (e.altKey) { return }
+ if (e.metaKey) { return }
+ if (e.shiftKey) {
+ if (e.ctrlKey) {
+ return;
+ } else {
+ // group select
+ }
+ } else {
+ if (e.ctrlKey) {
+ // region indication
+ } else {
+ drag_mousedown(e);
+ }
+ }
+}
+
+function drag_mousedown(e : MouseEvent) {
var target = e.target as SVGGraphicsElement; // we check this just now!
var piece = target.dataset.piece!;
if (!piece) { return; }
<p>
<svg id="space"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 110"
- onmousedown="drag_mousedown(event)"
+ onmousedown="some_mousedown(event)"
>
<rect fill="green" x="20" y="5" width="200" height="100"/>
<g id="pieces_marker"></g>