Java applets don't get key release events from browser




5 years ago
5 months ago


(Reporter: grosskopf, Unassigned)


({regression, testcase})

2.0 Branch
Mac OS X
regression, testcase

Firefox Tracking Flags

(Not tracked)



(1 attachment)

3.18 KB, application/octet-stream


5 years ago
When I run a java applet in Firefox listening for key events, the applet gets KEY_PRESSED and KEY_TYPED events, but doesn't get KEY_RELEASED events.
I tested this with Mac OS X 10.8.2, Java 1.7.0_17 and FireFox 19.0.2.
The same applet gets KEY_RELEASED events when started in Safari (Mac OS) or FireFox (Windows 7).
This bug can be reproduced always.


5 years ago
Component: General → Plug-ins
Product: Firefox → Core

Comment 1

5 years ago
Can you provide a minimal testcase? At this point I don't think this is a priority for my team, so I'd be happy for a volunteer to take this.
Flags: needinfo?
Keywords: testcase-wanted
Priority: -- → P3

Comment 2

5 years ago
Created attachment 722785 [details]
Test case applet

Open KeyReleaseTest.html in Firefox.
Flags: needinfo?

Comment 3

5 years ago
I added a minimal test case applet.
Open KeyReleaseTest.html in Firefox. You should see the applet as a red box (size 320x200 pixels). When you click it with your mouse you will see "Mouse pressed" on the console. Press a key and the output will be "Key pressed ..." and "Key typed ..." but no "Key released ...".
Here is the source code of the applet:

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JApplet;

public class KeyReleaseTestApplet extends JApplet {
	public void init() {
		addMouseListener( new MouseAdapter() {
			public void mousePressed( MouseEvent e) {
				System.out.println( "Mouse pressed.");
		addKeyListener( new KeyListener() {
			public void keyTyped( KeyEvent e) {
				System.out.println( "Key typed. e="+e);
			public void keyReleased( KeyEvent e) {
				System.out.println( "Key released. e="+e);
			public void keyPressed( KeyEvent e) {
				System.out.println( "Key pressed. e="+e);
	public void paint(Graphics gr) {
		gr.fillRect( 0,0,getWidth(), getHeight());

Comment 4

5 years ago
Thank you!
Ever confirmed: true


5 years ago
Keywords: testcase-wanted → testcase
Reporter, does this bug also happen with older versions of Firefox?

And if not, would you be willing to test trunk (aka mozilla-central) nightlies to find out in which this bug started happening?

This is something a volunteer could do.  But knowing the regression range might make a volunteer more likely to be interested in working on this bug.

Comment 6

5 years ago
This bug appears in older versions, too. Probably since Firefox 13:

Comment 7

5 years ago
Can you run to find a regression range?
Flags: needinfo?(grosskopf)
Keywords: regressionwindow-wanted

Comment 8

5 years ago
So far we don't know that it ever worked.

Comment 9

5 years ago
Running the mozregression tool I found that key released events worked until nightly build from 2011-01-20. In 2011-01-21 it is broken.
Flags: needinfo?(grosskopf)

Comment 10

5 years ago
The regression range is
I suspect bug 583499.
Keywords: regressionwindow-wanted → regression
Version: unspecified → 2.0 Branch

Comment 11

5 years ago
That's a bit surprising, but I don't see anything else in the range.

Comment 12

5 years ago
I have an additional information:
The bug only appears with Java 7.

Comment 13

4 years ago
Since Java 1.7.0_21 it is broken in Safari, too. So maybe this is an Jave/Oracle issue.
I'm marking this bug as WONTFIX per bug #1269807.

For more information see -
Last Resolved: 5 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.