keyboard shortcut for Undo, plus gratuitous use of ternary operator
[potlatch2.git] / net / systemeD / potlatch2 / controller / ControllerState.as
index 23946f433ae37915d7bed52d54fccf830c895a6c..8db5a012612f1ac70d504a4baaa01c1dde12f3fa 100644 (file)
@@ -45,6 +45,13 @@ package net.systemeD.potlatch2.controller {
                        return "(No state)";
                }
                
+               protected function sharedKeyboardEvents(event:KeyboardEvent):ControllerState {
+                       switch (event.keyCode) {
+                               case 90:        MainUndoStack.getGlobalStack().undo(); return null;             // Z
+                       }
+                       return null;
+               }
+               
                protected function sharedMouseEvents(event:MouseEvent, entity:Entity):ControllerState {
                        var paint:MapPaint = getMapPaint(DisplayObject(event.target));
             var focus:Entity = getTopLevelFocusEntity(entity);