-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.1.6, 1.4.1
-
Fix Understood
-
x86, sparc
-
linux, solaris_2.5.1
Name: mf23781 Date: 06/29/98
The Event tests in the JCK:
api/java_awt/interactive/EventTests.html
fail on Solaris due to the fact that keyReleased implements
incorrect behaviour. On Solaris the keyReleased event occurs
after about half a second regardless of whether the key has
been released or not. This is not a problem on NT as everything
works as designed.
The test case below shows this.
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class testkey extends Frame
{
public void init( ){
checkKey check = new checkKey();
setSize( 300, 300 );
setLayout(new GridLayout(0,1));
TextField message = new TextField( "Hello Sailor" );
message.addKeyListener( check );
add( message );
}
public static void main( String args[] )
{
testkey test = new testkey();
test.init( );
test.show( );
}
void testkey( )
{
}
}
class checkKey implements KeyListener
{
public int KeyHits = 0;
public void keyTyped( java.awt.event.KeyEvent e ) {
// System.out.println( e );
}
public void keyPressed( java.awt.event.KeyEvent e ) {
// System.out.println( e );
}
public void keyReleased( java.awt.event.KeyEvent e ) {
System.out.println( e );
KeyHits++;
}
}
Uncomment the System.out lines and another possible problem
can be seen. keyPressed and keyTyped events are generated for
each auto repeat if the key is held down. Is this behaving as
designed?
======================================================================
###@###.### 10/5/04 07:42 GMT
The Event tests in the JCK:
api/java_awt/interactive/EventTests.html
fail on Solaris due to the fact that keyReleased implements
incorrect behaviour. On Solaris the keyReleased event occurs
after about half a second regardless of whether the key has
been released or not. This is not a problem on NT as everything
works as designed.
The test case below shows this.
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class testkey extends Frame
{
public void init( ){
checkKey check = new checkKey();
setSize( 300, 300 );
setLayout(new GridLayout(0,1));
TextField message = new TextField( "Hello Sailor" );
message.addKeyListener( check );
add( message );
}
public static void main( String args[] )
{
testkey test = new testkey();
test.init( );
test.show( );
}
void testkey( )
{
}
}
class checkKey implements KeyListener
{
public int KeyHits = 0;
public void keyTyped( java.awt.event.KeyEvent e ) {
// System.out.println( e );
}
public void keyPressed( java.awt.event.KeyEvent e ) {
// System.out.println( e );
}
public void keyReleased( java.awt.event.KeyEvent e ) {
System.out.println( e );
KeyHits++;
}
}
Uncomment the System.out lines and another possible problem
can be seen. keyPressed and keyTyped events are generated for
each auto repeat if the key is held down. Is this behaving as
designed?
======================================================================
###@###.### 10/5/04 07:42 GMT
- duplicates
-
JDK-4839127 keyReleased events are fired improperly
-
- Closed
-
- relates to
-
JDK-4817479 Robot is generating multiple key events against single keystroke on Redhat Linux
-
- Closed
-