Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4434194

Mouse button 2 and 3 are reversed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Verified

      Description

      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");
              }
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rraysunw Richard Ray (Inactive)
                Reporter:
                bchristi Brent Christian
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: