JDK-6629657 : provide raw key code from underlying system without changing API.
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0u14
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2007-11-14
  • Updated: 2017-05-16
  • Resolved: 2007-12-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7
5.0u15 b01Fixed 6u10Fixed 7Resolved
Related Reports
Relates :  
Relates :  
Description
There should be a way for Java programmer to obtain an unique identifier for a key pressed. Presently, we only have certain part of keys covered by VK_* java keycodes. Sometimes a KEY_PRESSED/KEY_RELEASED is completely useless, with all fields filled with zeroes. 

A proper solution to this would be manifold involving addition of more keycodes and providing means to query a KeyEvent about (in some sense) raw keycodes. However all this would require API change and is possible only in a new release (jdk7 I presume). 

There should be a way to make a partial fix suitable for an update release, without API change.

Comments
EVALUATION Idea is, to append a raw (in some sense) keycode to a string returned by java.awt.event.KeyEvent.paramString(). In case of MS Windows, it may be a virtual keycode, in case of X Window - 1-st keycode from a keycode vector. User may query paramString() and obtain a substring tagged by "rawCode=" and containing a decimal keycode value.
14-11-2007