Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
    
What makes you think my mouse can middle click? –  ChristopheD Jan 14 '10 at 20:51
    
I know. I'm in a windows shop so I'm kinda used to the middle button. The app does make allowance for the less button-endowed, but it's not pretty. –  Daver Jan 14 '10 at 22:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.