On Mon, Jun 29, 1998 at 11:03:05AM +0200, Stefan Poppe wrote:
> Hello,
> 
> I'd like to report what I consider a bug in AWT event handling:
> 
> Create a Canvas and enable MouseEvents for it. Clicking on this canvas
> delivers 
> three MouseEvents to the method processMouseEvent: one for MOUSE_DOWN,
> one for 
> MOUSE_RELEASED, and one for MOUSE_CLICKED. The getModifiers() method of
> these 
> events returns an int which stands for e.g. the mouse button you used.
> If you use
> button 1 the modifier of the MOUSE_DOWN is 0 whereas the modifiers of 
> MOUSE_RELEASED and MOUSE_CLICKED is 16 (which is correct for
> BUTTON1_MASK). If
> you use button 2 or 3 all modifiers have the correct value. This happens
> with version 1.1.5v_5 and 1.1.6_v1,
> 
> If anybody knows a workaround for the first problem please tell me how
> to do it.

Yep, ran into this one also. Found this in the Swing libraries:

public static boolean isLeftMouseButton(MouseEvent anEvent) {
  return ((anEvent.getModifiers() & InputEvent.BUTTON1_MASK) == 
                InputEvent.BUTTON1_MASK ||
          (anEvent.getModifiers()  == 0));
          /*PENDING(ARNAUD) this is to workaround a bug on Solaris */
}
                                
Seems like it is not only a Bug on Solaris though:)

Marcel Ammerlaan

Reply via email to