File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,11 @@ import { EditorEditPreferencesComponent } from "./dialogs/edit-preferences/edit-
3333import { Toaster } from "../ui/shadcn/ui/sonner" ;
3434
3535import { EditorLayout } from "./layout" ;
36+ import { removeNodes } from "./layout/graph/remove" ;
3637
3738import "./nodes/camera" ;
3839import "./nodes/scene-link" ;
40+ import { isDomTextInputFocused } from "../tools/dom" ;
3941
4042export function createEditor ( ) : void {
4143 const theme = localStorage . getItem ( "editor-theme" ) ?? "dark" ;
@@ -154,6 +156,20 @@ export class Editor extends Component<IEditorProps, IEditorState> {
154156 label : "Show Command Palette" ,
155157 onKeyDown : ( ) => this . commandPalette . setOpen ( true ) ,
156158 } ,
159+ {
160+ global : true ,
161+ combo : "delete" ,
162+ preventDefault : true ,
163+ label : "Delete Selected Objects" ,
164+ onKeyDown : ( ) => {
165+ if ( ! isDomTextInputFocused ( ) ) {
166+ const selectedNodes = this . layout . graph . getSelectedNodes ( ) ;
167+ if ( selectedNodes . length > 0 ) {
168+ removeNodes ( this ) ;
169+ }
170+ }
171+ } ,
172+ } ,
157173 ] }
158174 >
159175 < EditorLayout editor = { this } ref = { ( ref ) => ( this . layout = ref ! ) } />
You can’t perform that action at this time.
0 commit comments