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

Applets do not receive keyReleased events in browser

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7u21
    • deploy
    • os_x

      FULL PRODUCT VERSION :
      1.7.0_21

      ADDITIONAL OS VERSION INFORMATION :
      Darwin Doom.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Safari version 6.0.3, and Firefox version 20.0 tested.

      A DESCRIPTION OF THE PROBLEM :
      Applets do not receive keyReleased events from the browser since 1.7.0_21. This bug affected 1.7.0_17 on firefox too. keyReleased events are delivered for 1 key, if two keys are pushed at the same time.

      REGRESSION. Last worked in version 7u17

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Compile the following code, and run it as an applet in Safari or firefox:
      2) open the java console
      3) push keys in sequence and release each
      4) push two keys at once and release boh

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      At 3, first " key down: a " is printed, then " key up: a " is printed.
      At 4, first " key down: a " " key down: s " is printed, then " key up: a " " key up: s " is printed.
      ACTUAL -
      At 3, only " key down: a " is printed.
      At 4, first " key down: a " " key down: s " is printed, then " key up: a " is printed.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import java.applet.Applet;
      import java.awt.event.*;

      public class TextDumbness extends Applet
      {
      private static final long serialVersionUID = -9119217490277606380L;

      public void init ()
      {
      System.out.println(System.getProperty( " java.version " ));

      addMouseWheelListener(new MouseWheelListener() {
      public void mouseWheelMoved(MouseWheelEvent e)
      {
      System.out.println( " scroll " );
      }
      });
              addKeyListener(new KeyListener() {
                  public void keyPressed(KeyEvent e)
                  {
                      System.out.println( " Key down: " + e.getKeyChar());
                  }
                  public void keyReleased(KeyEvent e)
                  {
                      System.out.println( " Key up: " + e.getKeyChar());
                  }
                  public void keyTyped(KeyEvent e)
                  {
                  }
              });
      }
      }

      ---------- END SOURCE ----------

            ddehaven David Dehaven (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: