Ver Fonte

Playground: Add more hotkeys to the playground (#27762)

- Escape for deselection
- Delete for node deletion
abc013 há 1 ano atrás
pai
commit
04c0514f47
1 ficheiros alterados com 8 adições e 1 exclusões
  1. 8 1
      playground/NodeEditor.js

+ 8 - 1
playground/NodeEditor.js

@@ -411,8 +411,15 @@ export class NodeEditor extends THREE.EventDispatcher {
 
 
 					this.preview = ! this.preview;
 					this.preview = ! this.preview;
 
 
-				}
+				} else if ( key === 'Delete' ) {
+
+					if ( this.canvas.selected ) this.canvas.selected.dispose();
+					
+				} else if ( key === 'Escape' ) {
 
 
+					this.canvas.select( null );
+
+				}
 			}
 			}
 
 
 		} );
 		} );