-
Bug
-
Resolution: Fixed
-
P1
-
1.4.0
-
beta
-
x86
-
windows_nt
-
Verified
BUTTON2_MASK and BUTTON3_MASK are reversed as of merlin b58. Run the following test on 1.3 and 1.4; the bug is easy to see. Just click on the window with the various mouse buttons. I reproduced the bug on NT4. Solaris is unaffected.
import java.awt.*;
import java.awt.event.*;
public class GetMouseModifiers implements MouseListener {
public GetMouseModifiers() {}
public static void main(String[] args) {
Frame f = new Frame("GetMouseModifiers");
f.setSize(200, 200);
f.addMouseListener(new GetMouseModifiers());
f.show();
}
public void mouseClicked(MouseEvent e) {
printModifiers(e.getModifiers());
}
public void mousePressed(MouseEvent e) {
printModifiers(e.getModifiers());
}
public void mouseReleased(MouseEvent e) {
printModifiers(e.getModifiers());
}
public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
public void printModifiers(int mod) {
if ((mod & InputEvent.BUTTON1_MASK) != 0) {
System.out.println(" BUTTON1_MASK");
}
if ((mod & InputEvent.BUTTON2_MASK) != 0) {
System.out.println(" BUTTON2_MASK");
}
if ((mod & InputEvent.BUTTON3_MASK) != 0) {
System.out.println(" BUTTON3_MASK");
}
}
}
import java.awt.*;
import java.awt.event.*;
public class GetMouseModifiers implements MouseListener {
public GetMouseModifiers() {}
public static void main(String[] args) {
Frame f = new Frame("GetMouseModifiers");
f.setSize(200, 200);
f.addMouseListener(new GetMouseModifiers());
f.show();
}
public void mouseClicked(MouseEvent e) {
printModifiers(e.getModifiers());
}
public void mousePressed(MouseEvent e) {
printModifiers(e.getModifiers());
}
public void mouseReleased(MouseEvent e) {
printModifiers(e.getModifiers());
}
public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
public void printModifiers(int mod) {
if ((mod & InputEvent.BUTTON1_MASK) != 0) {
System.out.println(" BUTTON1_MASK");
}
if ((mod & InputEvent.BUTTON2_MASK) != 0) {
System.out.println(" BUTTON2_MASK");
}
if ((mod & InputEvent.BUTTON3_MASK) != 0) {
System.out.println(" BUTTON3_MASK");
}
}
}
- relates to
-
JDK-4480834 REG: With a lefthanded mouse setup event for mouseDragged reports the wrong butt
-
- Closed
-