Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4840172
Votes 0
Synopsis Need some more explanation about KeyEvent.getKeyChar()
Category java:classes_awt
Reported Against tiger
Release Fixed 1.5(tiger)
State 10-Fix Delivered, bug
Priority: 5-Very Low
Related Bugs
Submit Date 31-MAR-2003
Description
Here is the current doc for KeyEvent.getKeyChar()

    /**
     * Returns the character associated with the key in this event.
     * For example, the key-typed event for shift + "a" returns the
     * value for "A".
     *
     * @return the Unicode character defined for this key event.
     *         If no valid Unicode character exists for this key event,
     *         keyChar is <code>CHAR_UNDEFINED</code>.
     */

Although the class docs for KeyEvent explain that the keyChar is for 
character input, and that character input is reported in KEY_TYPED events, 
users are sometimes confused about this.  We should explain that getKeyChar() 
should not be used for KeyReleased or KeyPressed methods.  
Work Around
N/A
Evaluation
This came up most recently as bugid 4835748.  
 xxxxx@xxxxx  2003-03-31
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang