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

KeyListeners wont get Alt+LeftArrow events when using special Logitech mouses

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description


      ###@###.### 2001-08-27
      --------------------------------
      I can not allocate this special Logitech mouse to reproduce the
      problem, so just log the bug with all the information.


      J2SE Version (please include all output from java -version flag):
       java version "1.4.0-beta_refresh"
       Java(TM) 2 Runtime Environment, Standard Edition (build1.4.0-beta_refresh-b72)
       Java HotSpot(TM) Client VM (build 1.4.0-beta_refresh-b72, mixed mode)


      Does this problem occur on J2SE 1.3? Yes / No (pick one)
       Yes


      Operating System Configuration Information (be specific):
       Win2K SP2


      Hardware Configuration Information (be specific):
       Netfinity 5000, Dual PIII 550, 1GB RAM


      Bug Description:
      Using a Logitech mouse with the extra button for the thumb, as well as
      the wheel button. Set them to be "Internet Back Command". This is
      essentially the keystroke Alt + LeftArrow. If use Spy in Windows, you can
      see the key events being generated *almost* like pushing Alt+LeftArrow
      normally. But if open up a Java app and put KeyListeners in every conceivable
      place, you don't get these events. If set the mouse to be anything that does
      NOT involve use of the Alt key it works fine. What actually happens is the
      Frame menu gets activated (the one on the icon decoration in the top-left
      corner, just like if you hit only Alt in a Java app on Windows).

      Steps to Reproduce (be specific):
      Use a mouse that has an extra button on Windows and set it to be the
      "Internet Back Command". Use a KeyListener in a simple Java app(MouseTest.java)
      to print out the key events. You won't get any for that action (and of course
      no mouse events either). However, using Spy you can see the key events being
      generated and the functionality working correctly in Win32 apps that use the
      Alt+LeftArrow command.

      Test program:
      public class MouseTest
      {
      public static void main(String[] args)
      {
      java.awt.Frame f = new java.awt.Frame("MouseTest");
      java.awt.Canvas c = new java.awt.Canvas();
      f.setLayout(null);
      f.add(c);
      c.setBounds(0, 0, 100, 100);
      f.setSize(100, 100);
      c.addKeyListener(new java.awt.event.KeyListener()
      {
      public void keyPressed(java.awt.event.KeyEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void keyTyped(java.awt.event.KeyEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void keyReleased(java.awt.event.KeyEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      });
      f.addKeyListener(new java.awt.event.KeyListener()
      {
      public void keyPressed(java.awt.event.KeyEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void keyTyped(java.awt.event.KeyEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void keyReleased(java.awt.event.KeyEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      });
      c.addMouseListener(new java.awt.event.MouseAdapter()
      {
      public void mousePressed(java.awt.event.MouseEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void mouseClicked(java.awt.event.MouseEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void mouseReleased(java.awt.event.MouseEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      });
      f.addMouseListener(new java.awt.event.MouseAdapter()
      {
      public void mousePressed(java.awt.event.MouseEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void mouseClicked(java.awt.event.MouseEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      public void mouseReleased(java.awt.event.MouseEvent evt)
      {
      System.out.println("evt=" + evt);
      }
      });
      f.addWindowListener(new java.awt.event.WindowAdapter()
      {
      public void windowClosing(java.awt.event.WindowEvent evt)
      {
      System.exit(0);
      }
      });
      f.setVisible(true);
      }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dav Andrei Dmitriev (Inactive)
              Reporter:
              tyao Ting-Yun Ingrid Yao (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: