tags:

views:

146

answers:

0

I've been writing a GWT app that does various simple things with images like pan, zoom, brighten, etc. when you click and drag the mouse. Everything is working really well in all the browsers, except Safari. Well, Chrome 3 was also a problem but my app now works fine in Chrome 4.

The problem is capturing the middle mouse down events. I've added mouse handlers to a widget class like this:

public class InteractiveThingy extends Composite implements
    HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseUpHandlers,
    HasMouseWheelHandlers 
{

    @Override
    public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
        return addDomHandler(handler, MouseDownEvent.getType());
    }
...
}

and I can subscribe to the mouse events elsewhere and handle them. I can see which button was pressed and apply the appropriate operation.

However, in Safari and Chrome 3, the handlers are never called when I press the middle mouse button. Instead, the multi-way scroll icon pops up. The middle mouse down event comes through on IE, FireFox and Chrome 4 just fine.

Is there some extra event handling (like event preview) needed to stop Safari from handling the middle mouse before my code gets its chance? Or perhaps I need to wait until Safari fixes the issue like Google did with Chrome.