Fix space-handling bugs - clear keys from EditController.keys during keyUp in all...
authorAndy Allan <andy@gravitystorm.co.uk>
Wed, 9 Mar 2011 14:08:04 +0000 (14:08 +0000)
committerAndy Allan <andy@gravitystorm.co.uk>
Wed, 9 Mar 2011 14:08:04 +0000 (14:08 +0000)
net/systemeD/potlatch2/EditController.as

index 93c7cb4..033ae78 100644 (file)
@@ -12,6 +12,7 @@ package net.systemeD.potlatch2 {
        import flash.geom.*;
        import flash.ui.Keyboard;
        import flash.text.TextField;
+    import mx.controls.TextArea;
 
     /** Controller for the main map editing window itself. The logic that responds to mouse and keyboard events is all 
     * buried in various ControllerState classes. */
@@ -97,8 +98,9 @@ package net.systemeD.potlatch2 {
                }
 
         private function keyUpHandler(event:KeyboardEvent):void {
-                       if (event.target is TextField) return;                          // not meant for us
-                       if (keys[event.keyCode]) { delete keys[event.keyCode]; }
+            if (keys[event.keyCode]) { delete keys[event.keyCode]; } 
+            if ((event.target is TextField) || (event.target is TextArea)) return;                             // not meant for us
+
                        if (FunctionKeyManager.instance().handleKeypress(event.keyCode)) { return; }
             
             if (event.keyCode == 77) { toggleSize(); } // 'M'