United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6629657 provide raw key code from underlying system without changing API.
JDK-6629657 : provide raw key code from underlying system without changing API.

Details
Type:
Enhancement
Submit Date:
2007-11-14
Status:
Resolved
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2007-12-07
Component:
client-libs
OS:
windows
Sub-Component:
java.awt
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u14
Fixed Versions:
5.0u15 (b01)

Related Reports
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

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.
                                     
2007-11-14



Hardware and Software, Engineered to Work Together