Did a little further testing... if I use Firefox when I am debugging I
get 2 KeyBoard events that are captured. The second event has the
correct keyCode that I am looking for (67).
If I debug using IE, only one event ever gets handled, its keyCode is
17. So I guess the question becomes, is Flash Player dropping the
second event, or is IE blocking it?
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Chyko
Sent: Monday, March 05, 2007 10:00 AM
To: [email protected]
Subject: RE: [flexcoders] Re: ctrl key with a combination -
doesnt seem to work
I am having the same problem. At least from where I am standing
there doesn't appear to be a way to capture the second key. I also get
true for the value of event.ctrlKey and 17 for event.keyCode.
Anyone have any insight?
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of jmorpher03
Sent: Monday, March 05, 2007 8:28 AM
To: [email protected]
Subject: [flexcoders] Re: ctrl key with a combination -
doesnt seem to work
Hi Adam,
That was a typo. Here's what I have :
public function myKeyDown(event:KeyboardEvent):void {
}
And I have specified the event listener in the DG as
<mx:DataGrid ... keyDown="myKeyDown(event)">
The problem is not with the Event generation. I have put
trace and it
seems to call the function when the event occurs. The
problem is
detecting the CTRL + <keycombination>.
The keyCode always returns 17 (for CTRL key) and the
ctrlKey is TRUE.
What happens to the keyCode of the other key , for Ex: C
or c which
would be 67 or 99 ???
Is there any other way of detecting it, which I am not
aware or is
this a Flex bug ? It does not work as suggestec in the
Flex help docs.
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Adam Royle" <[EMAIL PROTECTED]> wrote:
>
> Umm... you've got
>
> public void myKeyDown
>
> when it should be:
>
> public function myKeyDown...
>
> and make sure you have
>
> <mx:DataGrid ... keyDown="myKeyDown(event)"
>
>
> Adam
>
> ----- Original Message -----
> From: jmorpher03
> To: [email protected]
<mailto:flexcoders%40yahoogroups.com>
> Sent: Monday, March 05, 2007 9:11 PM
> Subject: [flexcoders] Re: ctrl key with a combination
- doesnt
seem to work
>
>
> Does anyone know how the the CTRL + <key combination>
work ? Is this a
> Flex bug ? The Flex sample code in the help docs talks
about this, but
> it doesn't seem to work. Whats wrong ???
>
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "jmorpher03" <asgartali@> wrote:
> >
> > Hi,
> >
> > I am trying to trap the ctrl key along with a
combination of any
other
> > alphanumeric key by using the following code on a
DataGrid control:
> >
> > public void myKeyDown(event:KeyBoardEvent):void {
> > if ( event.ctrlKey && event.keyCode == 67 ) // for
'C'
> > {
> > // copy selected row
> > }
> > }
> >
> > This does not seem to work. Nor is any other key
combination
detected
> > when we use the ctrl key.
> >
> > Isnt this the way to handle keyboard events ? Is
there any other
> > explicit way to handle it ?
> >
> > Regards,
> > Asgar.
> >
>