From 5994131d325dbc38f2dc2dd4cd9993357f3113a0 Mon Sep 17 00:00:00 2001 From: Aditya Mitra <55396651+aditya-mitra@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:44:01 +0530 Subject: [PATCH] rename hierarchy node using hotkey (#10963) Co-authored-by: Sam Mazer <162159423+SamMazerIR@users.noreply.github.com> --- .../editor/panels/Hierarchy/container/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/ui/src/components/editor/panels/Hierarchy/container/index.tsx b/packages/ui/src/components/editor/panels/Hierarchy/container/index.tsx index 09252525c2..ce27956fd9 100644 --- a/packages/ui/src/components/editor/panels/Hierarchy/container/index.tsx +++ b/packages/ui/src/components/editor/panels/Hierarchy/container/index.tsx @@ -173,6 +173,14 @@ function HierarchyPanelContents(props: { sceneURL: string; rootEntity: Entity; i } }) + useHotkeys(`${cmdOrCtrlString}+r`, (e) => { + e.preventDefault() + const selectedEntities = SelectionState.getSelectedEntities() + for (const entity of selectedEntities) { + onRenameNode(entity) + } + }) + const MemoTreeNode = useCallback( (props: HierarchyTreeNodeProps) => ( onRenameNode(contextSelectedItem!)} + endIcon={cmdOrCtrlString + ' + r'} > {t('editor:hierarchy.lbl-rename')}