Note: The operating system and the web browser will process keyboard events before Adobe Flash Player or AIR. For example, in Microsoft Internet Explorer, pressing Ctrl+W closes the browser window before any contained SWF file dispatches a keyboard event.
You can just do something similar to this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
private function init():void{
this.addEventListener(MouseEvent.CLICK, clickHandler);
this.addEventListener(KeyboardEvent.KEY_DOWN,keyPressed);
}
private function clickHandler(event:MouseEvent):void {
stage.focus = this;
}
private function keyPressed(evt:KeyboardEvent):void{
if(evt.ctrlKey && evt.keyCode == 65)
trace("CTRL A is pressed");
if(evt.ctrlKey && evt.keyCode == 66)
trace("CTRL B is pressed");
}
]]>
</mx:Script>
</mx:Application>
Then To write to the operating system clipboard:
import flash.desktop.ClipboardFormats;
var copy:String = "A string to copy to the system clipboard.";
Clipboard.generalClipboard.clear();
Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, copy);
To read from the operating system clipboard:
import flash.desktop.ClipboardFormats;
var pasteData:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;