delete points from ways
[potlatch2.git] / net / systemeD / potlatch2 / controller / SelectedWayNode.as
index 822cfb8e8b03325058b3b647e61319fa7895ec8a..4a5e99be6c844d73625b92ea1a8ffa663c86e88d 100644 (file)
@@ -1,5 +1,6 @@
 package net.systemeD.potlatch2.controller {
        import flash.events.*;
+       import flash.ui.Keyboard;
     import net.systemeD.potlatch2.EditController;
     import net.systemeD.halcyon.connection.*;
        import net.systemeD.halcyon.Globals;
@@ -69,7 +70,9 @@ package net.systemeD.potlatch2.controller {
 
                override public function processKeyboardEvent(event:KeyboardEvent):ControllerState {
                        switch (event.keyCode) {
-                               case 88:        return splitWay();
+                               case 88:                                        return splitWay();
+                               case Keyboard.BACKSPACE:        return deleteNode();
+                               case Keyboard.DELETE:           return deleteNode();
                        }
                        return this;
                }
@@ -118,6 +121,11 @@ package net.systemeD.potlatch2.controller {
 
                        return new SelectedWay(selectedWay);
                }
+               
+               public function deleteNode():ControllerState {
+                       selectedNode.remove();
+                       return new SelectedWay(selectedWay);
+               }
 
     }
 }