Steps to reproduce:
This behavior occurs only in Flash player ActiveX version in Internet Explorer.
In Firefox under Windows XP everything works as expected with handling CTRL+C keyboard keystrokes inside KeyboardEvent.KEY_DOWN event handlers.
1) Run this compiled MXML file in Internet Explorer browser:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
applicationComplete="onCreationComplete()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
private function onCreationComplete() : void {
stage.addEventListener(KeyboardEvent.KEY_DOWN, onStageKeyDown);
}
private function onStageKeyDown(event : KeyboardEvent) : void {
Alert.show("onStageKeyDown e.keyCode:" + event.keyCode.toString() + " e.ctrlKey=" + event.ctrlKey.toString());
}
]]>
</mx:Script>
</mx:Application>
2) Give the Flash application a focus with a mouse click
3) Press Ctrl+C with a keyboard
Actual Results:
1 Alert box is shown with a following content:
"onStageKeyDown e.keyCode:17 e.ctrkKey:true"
Expected Results:
2 Alert boxes are shown with a content:
"onStageKeyDown e.keyCode:67 e.ctrkKey:true"
"onStageKeyDown e.keyCode:17 e.ctrkKey:true"
Workaround (if any):
For handling every keyboard combinations that contains CTRL key like CTRL+C, CTRL+V, etc -> rely on KeyboardEvent.KEY_UP event.
Firefox seems to be ok.
On a mac, using either Safari or Firefox, if you use the COMMAND-"C" or other command combinations, you get -1 as the keycode.
My application is handling an internal clipboard and the client wants it to work with "standard" clipboard shortcuts, but all these issues are making it impossible.