Sorry if that is the case, my response was affected by the fact that I have
ran into that 0-bug yesterday.

On Thu, Jun 17, 2010 at 11:36 AM, Thomas Broyer <[email protected]> wrote:

>
>
> On 17 juin, 10:06, ruds <[email protected]> wrote:
> > Hello there,
> > I have a focus panel where i added a MouseDownHandler to it. now in my
> > MouseHandler i am doing the following:
> > public void onMouseDown(MouseDownEvent arg0) {
> > if(arg0.getNativeEvent().getKeyCode()==Event.BUTTON_LEFT){
> >
> > }else if(arg0.getNativeEvent().getKeyCode()==Event.BUTTON_RIGHT){
> > }
> >
> > The strange thing is IE, the keyCode returned if i do debug it is
> > always 0, it is working fine over FF and chrome and i need this in
> > order to differentiate right from left clicks.
> >
> > is this a browser compatibility issue or a gwt bug?
>
> Or a bug in your code? You're comparing mouse button codes with
> keyboard codes!
> You should use arg0.getNativeButton(), or eventually
> arg0.getNativeEvent().getButton().
> Also note that more than one button can be depressed at the same time,
> the value returned is a bit-field, so if you want to know if the left
> button is depressed, you should use
> arg0.getNativeButton&NativeEvent.BUTTON_LEFT!=0, you'd use
> arg0.getNativeButton()==NativeEvent.BUTTON_LEFT only you want to check
> that the left button, and only the left button, is depressed.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to