Skip to content

Commit

Permalink
Remove ctrl+x action and fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Aug 31, 2024
1 parent a1fc99c commit 7868002
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const shortcuts = [
{ key: ['g'], description: 'Toggle grid visibility' },
{ key: ['n'], description: 'Add new entity' },
{ key: ['o'], description: 'Toggle local between global transform' },
{ key: ['del | backspace'], description: 'Delete selected entity' }
{ key: ['delete | backspace'], description: 'Delete selected entity' }
],
[
{ key: ['0'], description: 'Toggle panels' },
Expand All @@ -24,11 +24,10 @@ const shortcuts = [
{ key: ['6'], description: 'Back view' },
{ key: ['7'], description: 'Front view' },

{ key: ['ctrl | cmd', 'x'], description: 'Cut selected entity' },
{ key: ['ctrl | cmd', 'c'], description: 'Copy selected entity' },
{ key: ['ctrl | cmd', 'v'], description: 'Paste entity' },
{ key: ['ctrl | cmd', 'c'], description: 'Copy selected entity' },
{ key: ['ctrl | cmd', 'v'], description: 'Paste entity' },
{ key: ['h'], description: 'Show this help' },
{ key: ['Esc'], description: 'Unselect entity' },
{ key: ['esc'], description: 'Unselect entity' },
{ key: ['ctrl', 'alt', 'i'], description: 'Switch Edit and VR Modes' }
]
];
Expand Down
12 changes: 3 additions & 9 deletions src/editor/lib/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Shortcuts = {
Events.emit('openhelpmodal');
}

// esc: close inspector
// esc: unselect entity
if (keyCode === 27) {
if (this.inspector.selectedEntity) {
this.inspector.selectEntity(null);
Expand Down Expand Up @@ -65,7 +65,7 @@ export const Shortcuts = {
Events.emit('togglegrid');
}

// backspace & supr: remove selected entity
// backspace & delete: remove selected entity
if (keyCode === 8 || keyCode === 46) {
removeSelectedEntity();
}
Expand Down Expand Up @@ -136,12 +136,6 @@ export const Shortcuts = {
AFRAME.INSPECTOR.selectedEntity &&
document.activeElement.tagName !== 'INPUT'
) {
// x: cut selected entity
if (event.keyCode === 88) {
AFRAME.INSPECTOR.entityToCopy = AFRAME.INSPECTOR.selectedEntity;
removeSelectedEntity(true);
}

// c: copy selected entity
if (event.keyCode === 67) {
AFRAME.INSPECTOR.entityToCopy = AFRAME.INSPECTOR.selectedEntity;
Expand All @@ -154,7 +148,7 @@ export const Shortcuts = {
}
}

// º: toggle sidebars visibility
// 0: toggle sidebars visibility
if (event.keyCode === 48) {
Events.emit('togglesidebar', { which: 'all' });
event.preventDefault();
Expand Down

0 comments on commit 7868002

Please sign in to comment.