Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta key to the possible multi selection keys on NME #12657

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/tools/nodeEditor/src/diagram/graphCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
private _frames: GraphFrame[] = [];

private _altKeyIsPressed = false;
private _ctrlKeyIsPressed = false;
private _multiKeyIsPressed = false;
private _oldY = -1;

public _frameIsMoving = false;
Expand Down Expand Up @@ -232,7 +232,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
}
} else {
if (selection instanceof GraphFrame) {
if (this._ctrlKeyIsPressed || forceKeepSelection) {
if (this._multiKeyIsPressed || forceKeepSelection) {
if (!this._selectedFrameAndNodesConflict([selection], this._selectedNodes) && !this._selectedFrames.includes(selection)) {
this._selectedFrames.push(selection);
}
Expand All @@ -243,7 +243,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
this._selectedPort = null;
}
} else if (selection instanceof GraphNode) {
if (this._ctrlKeyIsPressed || forceKeepSelection) {
if (this._multiKeyIsPressed || forceKeepSelection) {
if (!this._selectedFrameAndNodesConflict(this._selectedFrames, [selection]) && !this._selectedNodes.includes(selection)) {
this._selectedNodes.push(selection);
}
Expand Down Expand Up @@ -272,15 +272,15 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
"keydown",
(evt) => {
this._altKeyIsPressed = evt.altKey;
this._ctrlKeyIsPressed = evt.ctrlKey;
this._multiKeyIsPressed = evt.ctrlKey || evt.metaKey;
},
false
);
this.props.globalState.hostDocument!.defaultView!.addEventListener(
"blur",
() => {
this._altKeyIsPressed = false;
this._ctrlKeyIsPressed = false;
this._multiKeyIsPressed = false;
},
false
);
Expand Down Expand Up @@ -369,7 +369,7 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP

onKeyUp() {
this._altKeyIsPressed = false;
this._ctrlKeyIsPressed = false;
this._multiKeyIsPressed = false;
this._oldY = -1;
}

Expand Down