3 Replies Latest reply on Jul 21, 2010 12:55 AM by Alisa(Ying) Wang

    copy paste short-cut not function under Mac OS 10.5

    ilsh Level 1

      The TextInput component accepts shortcuts such as Apple-C and Apple-V under Mac OS 10.4and Windows. But in 10.5 the shortcut doesnt work.

        • 1. Re: copy paste short-cut not function under Mac OS 10.5
          Alisa(Ying) Wang

          Hi ilsh,

           

          I tried with  text/textinput/textArea in simple code. the shortcuts(cmd+c/v/a) work well on mac 10.5 , mac 10.6 . and i also tried some popular  air app, such as TweetDeck , Twhirl,and AOL.  no issue founded

           

          So i think there maybe some special/corner  thing i missed ,Could you please share us some pieces of sample code to reproduce this bug?

          <mx:TextArea

           

          x="63" y="146" width="274" >

           

           

          <mx:Text x="63" y="215" text="Text" width="274"/>

           

           

          <mx:TextArea x="63" y="241" width="274"/>

           

          Thanks.

          Alisa

          AIR Eng

          • 2. Re: copy paste short-cut not function under Mac OS 10.5
            ilsh Level 1

            The shortcuts relies on the default "Edit" menu which comes with every

            AIR app. I need to create a custom menu so I remove the "Edit" menu.

            The shortcuts no long work.

             

            ilsh

            • 3. Re: copy paste short-cut not function under Mac OS 10.5
              Alisa(Ying) Wang Level 1

              Hi ilsh,

               

              Thanks for your useful info . now  i can reproduce it by removing/customizing the default mac "Edit" menu.

               

               

              1. It is not an AIR bug. finally i found it was because of different menu  mechanism on mac.

              “Copy and paste functionality is commonly triggered through menu commands and keyboard shortcuts. On OS X, an edit menu with the copy and paste commands is automatically created by the operating system, but you must add listeners to these menu commands to hook up your own copy and paste functions”

               

              2. For more details , please refer to the help doc:

                  http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7d5a. html

               

               

              3. How to make the shortcut still work on mac after  removing/customizing the default mac "Edit" menu:

               

                 after your customize your default "Edit" menu, add menu commands by yourself as follows on mac:

              private

               

               

              function init():void

              {

              stage.addEventListener(KeyboardEvent.KEY_DOWN, keyListener);

              }

               

               

              private function keyListener(event:KeyboardEvent):void

              {

               

              if (event.commandKey)

              {

              event.preventDefault();

               

              switch (String.fromCharCode(event.charCode))

              {

               

              case "c":

              NativeApplication.nativeApplication.copy();

               

              break;

               

              case "x":

              NativeApplication.nativeApplication.cut();

               

              break;

               

              case "v":

              NativeApplication.nativeApplication.paste();

               

              break;

               

              case "a":

              NativeApplication.nativeApplication.selectAll();

               

              break;

               

              }

              }

              }

               

               

               

               

               

               

              I tested it , works well. please try again.

               

              Thanks

              Alisa

              AIR Eng