JDK-4069417 : Java doesn't send proper events for composed chars (like ��)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt:i18n
  • Affected Version: 1.1.3
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1997-08-04
  • Updated: 2000-03-15
  • Resolved: 2000-03-15
Related Reports
Duplicate :  
Description
When I type into a textfield the sequence Compose then ' then a, it puts the
text "��" into the field, which is good. Unfortunately the events it sends to
the component are not as good:

java.awt.event.KeyEvent[KEY_PRESSED,keyCode=192,keyChar='`'] on textfield0
java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyChar='`'] on textfield0
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=192,keyChar='`'] on textfield0
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=65,keyChar='a'] on textfield0
java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyChar='a'] on textfield0
java.awt.event.TextEvent[TEXT_VALUE_CHANGED] on textfield0
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=65,keyChar='a'] on textfield0

Note that nothing is delived to correspond to the Compose key, and no event 
makes mention of the char value "��".

The implications of this lack of event creation are that lightweights cannot
handle these extended characters, because they have no way of differentiating
"'a'e~n" from "������".

Try composed characters in the JFC!

Comments
EVALUATION Assumption: The submitter reports the problem with awt.textfield and not textfield component found in swing. This problem is reproducable with JDK1.1.X frame work. Attached program reproduces the bug. It is reproducable with Solaris 2.5 and Solaris 2.6 jeff.dunn@Eng 1997-12-19 Just to clarify, the problem does not exist with awt.TextField. Native widgets work well, it's the lightweights that have a problem. This has been fixed for 1.1.6 and up under 4040458. Lightweight components now get a correct sequence of KEY_TYPED events - in this case, just one KEY_TYPED event containing "��". The Swing text components work correctly with these events. KEY_PRESSED and and KEY_RELEASED events may get swallowed by input methods (composed keys are handled by an input method on Solaris), and applications should not rely on them for character input. norbert.lindenberg@Eng 2000-03-14
14-03-2000