JDK-4435010 : No way to determine if KeyTyped valid key sequence
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.8,1.3.0,1.4.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic,solaris_7
  • CPU: generic,sparc
  • Submitted: 2001-04-06
  • Updated: 2008-04-08
Related Reports
Duplicate :  
Relates :  
Description
We had a meeting on this a while back, but I'm going to file a bug on it as we are running into this problem more and more.
The basic problem is that when Swing gets a KeyTyped event we have no way of knowing if it is a valid key combination, or perhaps the only way to type the key. For example, pressing Ctrl-c results in a KeyTyped with a 'c' char and CTRL modifier. Typically you don't want such key sequences to appear in a text widgets, and thus we filter them. We also filter Alt keys for the same reason. The problem then comes that in some locales and some keyboards you need to type alt to produce certain characters. Since we filter these out, the user can then no longer enter these characters.

. Don't produce KeyTyped events unless this is the only way to enter the character.
. Provide some API to determine if this is the only way to enter the character.

Comments
EVALUATION We should try to look at this in the Merlin time frame. However, changing the way we report modifiers will be hard; there are a number of regression tests that codify the way we do it now, and we have at least one licensee who feels strongly that we should do it this way. Commit to fix in merlin (swing). eric.hawkes@eng 2001-04-06
06-04-2001