press S to save, C to close changeset
[potlatch2.git] / net / systemeD / potlatch2 / controller / ControllerState.as
index 4a2d433..42ee032 100644 (file)
@@ -6,6 +6,7 @@ package net.systemeD.potlatch2.controller {
     import net.systemeD.halcyon.connection.*;
     import net.systemeD.potlatch2.EditController;
        import net.systemeD.halcyon.Globals;
+       import net.systemeD.potlatch2.save.SaveManager;
 
     public class ControllerState {
 
@@ -51,9 +52,13 @@ package net.systemeD.potlatch2.controller {
                
                protected function sharedKeyboardEvents(event:KeyboardEvent):ControllerState {
                        switch (event.keyCode) {
-                               case 68:        controller.map.paint.alpha=1.3-controller.map.paint.alpha; return null; // D
-                               case 87:        if (selectedWay) { return new SelectedWay(selectedWay); }; return null; // W
-                               case 90:        MainUndoStack.getGlobalStack().undo(); return null;                                             // Z
+                               case 67:        controller.connection.closeChangeset(); break;                                                  // C - close changeset
+                               case 68:        controller.map.paint.alpha=1.3-controller.map.paint.alpha; return null; // D - dim
+                               case 83:        SaveManager.saveChanges(); break;                                                                               // S - save
+                               case 84:        controller.tagViewer.togglePanel(); return null;                                                // T - toggle tags panel
+                               case 87:        if (selectedWay) { return new SelectedWay(selectedWay); }; return null; // W - select way
+                               case 90:        MainUndoStack.getGlobalStack().undo(); return null;                                             // Z - undo
+                               case 187:       controller.tagViewer.addNewTag(); return null;                                                  // + - add tag
                        }
                        return null;
                }
@@ -92,6 +97,8 @@ package net.systemeD.potlatch2.controller {
                                }
                        } else if ( event.type == MouseEvent.MOUSE_UP && focus == null && map.dragstate!=map.DRAGGING) {
                                return (this is NoSelection) ? null : new NoSelection();
+                       } else if ( event.type == MouseEvent.MOUSE_UP && focus && map.dragstate==map.DRAGGING) {
+                               map.mouseUpHandler();   // in case the end-drag is over an EntityUI
                        } else if ( event.type == MouseEvent.ROLL_OVER ) {
                                controller.map.setHighlight(focus, { hover: true });
                        } else if ( event.type == MouseEvent.MOUSE_OUT ) {