JDK-4400614 : Unable to construct a KeyStroke with keyChar and modifiers from a string.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-12-22
  • Updated: 2002-06-21
  • Resolved: 2001-01-04
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 12/22/2000


20 Dec 2000, eval1127@eng -- only open bug that's related appears to
be # 4370733 (which is not the same issue)
--------------
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

Problem:
When a string with a keyChar and a modifier is used as an
argument for the getKeyStroke method in the KeyStroke class, a
KeyStroke is returned with only the keyChar and no modifiers.

Example:

import javax.swing.KeyStroke;
public class test{

public static void main (String [] args) {
    System.out.println(KeyStroke.getKeyStroke("control typed c"));
}
}

Results: keyChar c-P

Expected Result: keyChar Ctrlc-P
(Review ID: 110519) 
======================================================================

Comments
EVALUATION I am reassigning to AWT as AWTKeyStroke now handles this functionality. scott.violet@eng 2001-01-03 This has been fixed in merlin as part of the focus rewrite. The string put out is keyChar Ctrlc Note that there is no -P at the end, as the submitter expects, because the key stroke being constructed is for "typed", not "pressed". hania.gajewska@Eng 2001-01-04
2001-01-04