Skip to main content
Inspiring
December 18, 2009
Answered

Copy and paste keys disabled in latest build? (OSX)

  • December 18, 2009
  • 1 reply
  • 902 views

Previously Ctrl+c, and Ctrl+v allowed me to copy and paste editable TLF text in AIR 1.5.3 on OSX. Since updating to the SWCs in the Flex 4 beta 2 build (502 -715519), this no longer works on OSX, but continues to work OK on Windows.

I know it shouldn't really be Ctrl anyway (instead Cmd) but users could at least use keys to perform these operations. Now it seems to replace the selected text with the letter pressed (c, v, x), ignoring the event.controlKey attribute?

I don't see anything in the EditManager or SelectionManager relating to handling copy and paste, is this something the built in to the text engine now? The only mentions I see to copy and paste are to do with the context menu (forgive me if I've just missed something).

I've tried to confirm I'm not doing anything funky in my code (disabled all related event handling and so on) but I'd be interested to hear whether anyone knows any more about this regarding Mac support to see whether it's a genuine issue?

Also quick sidenote, I saw an interesting note in the source:

    // CTRL/CMD+z: Only on Mac when using a pre-Argo player version

I've not found anything online about this codename, perhaps player 10, 10.1? Does this mean future Flash Players will disable Cmd+Z?

Thanks as always for your help with this.

Richard

This topic has been closed for replies.
Correct answer

Hmm. I'm using the 3.4 SDK, and the textLayout.swc from the 4.0 SDK installed with Flash Builder beta 2 (4.0.0.10485). I'm running with adl from the AIR 1.5.3 SDK. What I'm running is this app, and the keys are working for me.

<?xml version="1.0" encoding="utf-8"?>

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"

layout="absolute"

creationComplete = "onCC()">

<mx:Script>

<![CDATA[

import flashx.textLayout.container.ContainerController;

import flashx.textLayout.edit.EditManager;

import flashx.textLayout.elements.ParagraphElement;

import flashx.textLayout.elements.SpanElement;

import flashx.textLayout.elements.TextFlow;

public function onCC():void

{

var textFlow:TextFlow = new TextFlow();

var p:ParagraphElement = new ParagraphElement();

var span:SpanElement = new SpanElement();

span.text = "Hello, World";

span.fontSize = 48;

p.addChild(span);

textFlow.addChild(p);

var container:Sprite = new Sprite();

textFlow.flowComposer.addController(new ContainerController(container));

textFlow.interactionManager = new EditManager();

canvas.rawChildren.addChild(container);

textFlow.flowComposer.updateAllControllers();

}

]]>

</mx:Script>

<mx:Canvas id="canvas" height="400" width="200"/>

</mx:WindowedApplication>

1 reply

December 18, 2009

Have you tried using command-c and command-v? Those keys work for me in AIR 1.5 and 2.0. I do see the 'c' and 'v' text entry for the control keys in 1.5 (that appears fixed in 2.0 - those keys do nothing there).

Inspiring
December 18, 2009

Hi Alan,

Thanks for the response. Cmd does the same, I'm using AIR 1.5.3, building with Flex SDK 3.4 (since 3.5 has a bug with the ApplicationUpdaterUI - avoid using 3.5 if you need this btw), the TLF swc is from Flex 4 beta 2. Which builds are you using when it comes to Flex SDK, TLF and which 1.5.X runtime just out of interest?

I could try 2.0 but unfortunately we're committed to delivering using 1.5.3 on this one.

Cheers,

Richard

Correct answer
December 18, 2009

Hmm. I'm using the 3.4 SDK, and the textLayout.swc from the 4.0 SDK installed with Flash Builder beta 2 (4.0.0.10485). I'm running with adl from the AIR 1.5.3 SDK. What I'm running is this app, and the keys are working for me.

<?xml version="1.0" encoding="utf-8"?>

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"

layout="absolute"

creationComplete = "onCC()">

<mx:Script>

<![CDATA[

import flashx.textLayout.container.ContainerController;

import flashx.textLayout.edit.EditManager;

import flashx.textLayout.elements.ParagraphElement;

import flashx.textLayout.elements.SpanElement;

import flashx.textLayout.elements.TextFlow;

public function onCC():void

{

var textFlow:TextFlow = new TextFlow();

var p:ParagraphElement = new ParagraphElement();

var span:SpanElement = new SpanElement();

span.text = "Hello, World";

span.fontSize = 48;

p.addChild(span);

textFlow.addChild(p);

var container:Sprite = new Sprite();

textFlow.flowComposer.addController(new ContainerController(container));

textFlow.interactionManager = new EditManager();

canvas.rawChildren.addChild(container);

textFlow.flowComposer.updateAllControllers();

}

]]>

</mx:Script>

<mx:Canvas id="canvas" height="400" width="200"/>

</mx:WindowedApplication>