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

Remove buggy ctrl+x to cut entity to paste it right away #759

Merged
merged 5 commits into from
Sep 8, 2024
Merged
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
9 changes: 4 additions & 5 deletions src/components/modals/ModalHelp.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class ModalHelp extends React.Component {
{ key: ['g'], description: 'Toggle grid visibility' },
{ key: ['n'], description: 'Add new entity' },
{ key: ['o'], description: 'Toggle local between global transform' },
{ key: ['supr | backspace'], description: 'Delete selected entity' }
{ key: ['delete | backspace'], description: 'Delete selected entity' }
],
[
{ key: ['0'], description: 'Toggle panels' },
Expand All @@ -51,11 +51,10 @@ export default class ModalHelp extends React.Component {
{ 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/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 @@ -70,7 +70,7 @@ export const Shortcuts = {
Events.emit('entitycreate', { element: 'a-entity', components: {} });
}

// backspace & supr: remove selected entity
// backspace & delete: remove selected entity
if (keyCode === 8 || keyCode === 46) {
removeSelectedEntity();
}
Expand Down Expand Up @@ -129,12 +129,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