mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
This reverts commit 23796d9040.
This commit is contained in:
@@ -1285,10 +1285,8 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e.type == 'keydown' && !e.repeat) {
|
if (e.type == 'keydown' && !e.repeat) {
|
||||||
const key = e.code
|
|
||||||
|
|
||||||
// Ctrl + M mute/unmute
|
// Ctrl + M mute/unmute
|
||||||
if (key === 'KeyM' && (e.metaKey || e.ctrlKey)) {
|
if (e.key === 'm' && (e.metaKey || e.ctrlKey)) {
|
||||||
if (this.selected_nodes) {
|
if (this.selected_nodes) {
|
||||||
for (var i in this.selected_nodes) {
|
for (var i in this.selected_nodes) {
|
||||||
if (this.selected_nodes[i].mode === 2) {
|
if (this.selected_nodes[i].mode === 2) {
|
||||||
@@ -1303,7 +1301,7 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl + B bypass
|
// Ctrl + B bypass
|
||||||
if (key === 'KeyB' && (e.metaKey || e.ctrlKey)) {
|
if (e.key === 'b' && (e.metaKey || e.ctrlKey)) {
|
||||||
if (this.selected_nodes) {
|
if (this.selected_nodes) {
|
||||||
for (var i in this.selected_nodes) {
|
for (var i in this.selected_nodes) {
|
||||||
if (this.selected_nodes[i].mode === 4) {
|
if (this.selected_nodes[i].mode === 4) {
|
||||||
@@ -1318,7 +1316,7 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// p pin/unpin
|
// p pin/unpin
|
||||||
if (key === 'KeyP') {
|
if (e.key === 'p') {
|
||||||
if (this.selected_nodes) {
|
if (this.selected_nodes) {
|
||||||
for (const i in this.selected_nodes) {
|
for (const i in this.selected_nodes) {
|
||||||
const node = this.selected_nodes[i]
|
const node = this.selected_nodes[i]
|
||||||
@@ -1329,7 +1327,7 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Alt + C collapse/uncollapse
|
// Alt + C collapse/uncollapse
|
||||||
if (key === 'KeyC' && e.altKey) {
|
if (e.key === 'c' && e.altKey) {
|
||||||
if (this.selected_nodes) {
|
if (this.selected_nodes) {
|
||||||
for (var i in this.selected_nodes) {
|
for (var i in this.selected_nodes) {
|
||||||
this.selected_nodes[i].collapse()
|
this.selected_nodes[i].collapse()
|
||||||
@@ -1339,18 +1337,22 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl+C Copy
|
// Ctrl+C Copy
|
||||||
if (key === 'KeyC' && (e.metaKey || e.ctrlKey)) {
|
if (e.key === 'c' && (e.metaKey || e.ctrlKey)) {
|
||||||
// Trigger onCopy
|
// Trigger onCopy
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl+V Paste
|
// Ctrl+V Paste
|
||||||
if (key === 'KeyV' && (e.metaKey || e.ctrlKey) && !e.shiftKey) {
|
if (
|
||||||
|
(e.key === 'v' || e.key == 'V') &&
|
||||||
|
(e.metaKey || e.ctrlKey) &&
|
||||||
|
!e.shiftKey
|
||||||
|
) {
|
||||||
// Trigger onPaste
|
// Trigger onPaste
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((key === 'NumpadAdd' || key === 'Equal') && e.altKey) {
|
if (e.key === '+' && e.altKey) {
|
||||||
block_default = true
|
block_default = true
|
||||||
let scale = this.ds.scale * 1.1
|
let scale = this.ds.scale * 1.1
|
||||||
this.ds.changeScale(scale, [
|
this.ds.changeScale(scale, [
|
||||||
@@ -1360,9 +1362,9 @@ export class ComfyApp {
|
|||||||
this.graph.change()
|
this.graph.change()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((key === 'NumpadSubtract' || key === 'Minus') && e.altKey) {
|
if (e.key === '-' && e.altKey) {
|
||||||
block_default = true
|
block_default = true
|
||||||
let scale = this.ds.scale / 1.1
|
let scale = (this.ds.scale * 1) / 1.1
|
||||||
this.ds.changeScale(scale, [
|
this.ds.changeScale(scale, [
|
||||||
this.ds.element.width / 2,
|
this.ds.element.width / 2,
|
||||||
this.ds.element.height / 2
|
this.ds.element.height / 2
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ export class ChangeTracker {
|
|||||||
|
|
||||||
async undoRedo(e) {
|
async undoRedo(e) {
|
||||||
if (e.ctrlKey || e.metaKey) {
|
if (e.ctrlKey || e.metaKey) {
|
||||||
if (e.code === 'KeyY') {
|
if (e.key === 'y') {
|
||||||
this.updateState(this.redo, this.undo)
|
this.updateState(this.redo, this.undo)
|
||||||
return true
|
return true
|
||||||
} else if (e.code === 'KeyZ') {
|
} else if (e.key === 'z') {
|
||||||
this.updateState(this.undo, this.redo)
|
this.updateState(this.undo, this.redo)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user