mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Implement shift+click
This commit is contained in:
+16
-6
@@ -238,12 +238,16 @@ export class SelectionManager extends EventEmitter {
|
||||
this._setMouseClickCount();
|
||||
console.log(this._clickCount);
|
||||
|
||||
if (this._clickCount === 1) {
|
||||
this._onSingleClick(event);
|
||||
} else if (this._clickCount === 2) {
|
||||
this._onDoubleClick(event);
|
||||
} else if (this._clickCount === 3) {
|
||||
this._onTripleClick(event);
|
||||
if (event.shiftKey) {
|
||||
this._onShiftClick(event);
|
||||
} else {
|
||||
if (this._clickCount === 1) {
|
||||
this._onSingleClick(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
|
||||
@@ -253,6 +257,12 @@ export class SelectionManager extends EventEmitter {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
private _onShiftClick(event: MouseEvent): void {
|
||||
if (this._model.selectionStart) {
|
||||
this._model.selectionEnd = this._getMouseBufferCoords(event);
|
||||
}
|
||||
}
|
||||
|
||||
private _onSingleClick(event: MouseEvent): void {
|
||||
this._model.selectionStartLength = 0;
|
||||
this._model.isSelectAllActive = false;
|
||||
|
||||
Reference in New Issue
Block a user