Implement shift+click

This commit is contained in:
Daniel Imms
2017-06-06 14:19:12 -07:00
parent d3865ad23f
commit db8ded2a02
+16 -6
View File
@@ -238,12 +238,16 @@ export class SelectionManager extends EventEmitter {
this._setMouseClickCount(); this._setMouseClickCount();
console.log(this._clickCount); console.log(this._clickCount);
if (this._clickCount === 1) { if (event.shiftKey) {
this._onSingleClick(event); this._onShiftClick(event);
} else if (this._clickCount === 2) { } else {
this._onDoubleClick(event); if (this._clickCount === 1) {
} else if (this._clickCount === 3) { this._onSingleClick(event);
this._onTripleClick(event); } else if (this._clickCount === 2) {
this._onDoubleClick(event);
} else if (this._clickCount === 3) {
this._onTripleClick(event);
}
} }
// Listen on the document so that dragging outside of viewport works // Listen on the document so that dragging outside of viewport works
@@ -253,6 +257,12 @@ export class SelectionManager extends EventEmitter {
this.refresh(); this.refresh();
} }
private _onShiftClick(event: MouseEvent): void {
if (this._model.selectionStart) {
this._model.selectionEnd = this._getMouseBufferCoords(event);
}
}
private _onSingleClick(event: MouseEvent): void { private _onSingleClick(event: MouseEvent): void {
this._model.selectionStartLength = 0; this._model.selectionStartLength = 0;
this._model.isSelectAllActive = false; this._model.isSelectAllActive = false;