Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -375,25 +375,53 @@ export class MouseControls {

if ((event.ctrlKey || event.metaKey) && !this.isProcessing) {
const keyLower = event.key.toLowerCase();
if (keyLower === "z") {
// redo
if (keyLower === "z" && !event.shiftKey) {
// undo
event.preventDefault();
this.isProcessing = true;
try {
await this.sceneManager?.undo();
} finally {
this.isProcessing = false;
}
} else if (keyLower === "z" && event.shiftKey) {
// redo (Ctrl+Shift+Z / Cmd+Shift+Z)
event.preventDefault();
this.isProcessing = true;
try {
await this.sceneManager?.redo();
} finally {
this.isProcessing = false;
}
} else if (keyLower === "y" && !event.metaKey) {
// redo (Ctrl+Y, Windows/Linux)
event.preventDefault();
this.isProcessing = true;
await this.sceneManager?.redo();
this.isProcessing = false;
try {
await this.sceneManager?.redo();
} finally {
this.isProcessing = false;
}
} else if (keyLower === "c") {
// Copy
event.preventDefault();
event.stopPropagation();
this.isProcessing = true;
await this.sceneManager?.copy();
this.isProcessing = false;
try {
await this.sceneManager?.copy();
} finally {
this.isProcessing = false;
}
} else if (keyLower === "v") {
// Paste
event.preventDefault();
event.stopPropagation();
this.isProcessing = true;
await this.sceneManager?.paste();
this.isProcessing = false;
try {
await this.sceneManager?.paste();
} finally {
this.isProcessing = false;
}
} else if (event.key === "0") {
// Stats Menu
this.enable_stats();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const isHotkeyDisabled = ()=>{
export const disableHotkeyInput = (level: number)=>{
if(hotkeysStatus.value.disabled === true){
if (level > hotkeysStatus.value.disabledBy){
hotkeysStatus.value.disabledBy === level;
hotkeysStatus.value = { ...hotkeysStatus.value, disabledBy: level };
}
}else{
hotkeysStatus.value = {
Expand Down