History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: FP-106
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Fix
Assignee: Charles Liss
Reporter: Andriy Panas
Votes: 5
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
Flash Player

event.keyCode for joint key keyboard strokes with CTRL key present like CTRL+C has wrong value inside KeyboardEvent.KEY_DOWN event

Created: 04/15/08 07:02 AM   Updated: 09/05/08 04:55 PM
Component/s: ActionScript Events
Security Level: Public (All JIRA Users )

Severity: Incorrectly Functioning
Reproducibility: Every Time
Discoverability: High
Found in Version: Flash Player 9 - 9_0_115_0
Milestone: Flash Player 9
Affected OS(s): Windows - XP
Injection: No
Steps to Reproduce:
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.


 
 
 
Language Found: English
Bugbase Id: none
Triaged: No
Resolved by: Charles Liss
Participants: Andriy Panas, Charles Liss, Edwin Wong and Mark DeMichele
Browser: Internet Explorer 7.x


 All   Comments      Sort Order:
Mark DeMichele - [06/25/08 05:40 PM ]
It's actually worse than stated. In IE 6/Win XP, if you hold the CTRL key down and press "C", you get and then repeat by still holding down the control and releasing "C" and pressing it again, at some point it will stop getting any events. You then have to release the CTRL key.

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.

Charles Liss - [08/27/08 03:59 PM ]
From the research I have found this is a issue with Internet Explorer than we currently do not have a solution for. IE is trapping the CTRL key events before we can do anything. Its a issue that is known.

Charles Liss - [08/27/08 04:01 PM ]
This is a problem we are trying to work around in Internet Explorer. It will be address in a future version of Flash Player.

Charles Liss - [09/05/08 04:27 PM ]
cannot be fixed

Mark DeMichele - [09/05/08 04:55 PM ]
I do believe this may be fixable. I've written ActiveX controls in the past that can capture these keys in IE. If I'm not mistaken, Flash is just an ActiveX control.

I believe the key is to implement the IOleInPlaceActiveObject interface. Inside that you handle the TranslateAccelerator method. That's how I did it if my memory serves me correct.