-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.1
-
None
-
sparc
-
solaris_2.5
Name: mc57594 Date: 03/07/97
(int)KeyEvent.getKeyChar() returns 0xff08 when the key is a
backspace
while (int)'\b' = 0x0008. This impacts checking characters
typed
in for backspace. Workaround is to also check the key
code
(eg getKeyCode() == KeyEvent.VK_BACK_SPACE).
This only happens on solaris appletviewer, not on Windows 95
appletviewer
******* TESTCASE
******
import
java.awt.*;
import
java.awt.event.*;
import
java.applet.*;
public class Bug13Applet extends Applet implements
KeyListener
{
TextField tf1 = new TextField("Type backspace in
me");
public void
init()
{
tf1.addKeyListener(this);
add(tf1);
}
public void keyReleased(KeyEvent e)
{}
public void keyTyped(KeyEvent e)
{}
public void keyPressed(KeyEvent
e)
{
System.out.println(e.toString());
System.out.println("(int)getKeyChar() = " +
(int)(e.getKeyChar()));
System.out.println("(int)'\\b' = " +
((int)'\b'));
}
}
======================================================================