JDK-6275736 : PIT. Invalid key code returned for F11 and F12 keys
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-05-25
  • Updated: 2011-01-19
  • Resolved: 2005-07-23
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.
JDK 6
6 b45Fixed
Related Reports
Relates :  
Description
This occurs on AWT PIT build for mustang b39 - On Solaris and Linux.

KeyEvent.getKeyCode returns invalid value for F11 and F12 keys. The values returned are 65480 and 65481 respectively. Test ran on English locale.

To reproduce:
1. Run the attached automated testcase

###@###.### 2005-05-25 07:39:05 GMT

Comments
EVALUATION Note that it works on Solaris Sparc (at least CDE). Sparc keyboard Stop (XK_L1) key does generate the same keysym as Intel's F11 while Sparc F11 does generate SunXK_F36 keysym. There is both VK_STOP and VK_F11 Java keycodes. As we have presently one-to-one hash keysym-to-jkeycode, last put VK_STOP is always generated. Stupid. One can check, however, (eg with MToolkit) that previous implementation was not much better: on Sparc keyboard, both Stop and F11 generate VK_F11 - there is an array and simple search in it which always stop on XK_F11 --> F11, also one-to-one. So I can eliminate this regression by a simple removal of XK_L1 --> VK_STOP pair - which will break the program as it was broken before. Proper solution would be, to have heuristics to recognize what exactly keyboard do we have. How about SunRay here? ###@###.### 2005-05-25 12:28:48 GMT
25-05-2005

SUGGESTED FIX A palliative is, to remove two lines from XKeysym.java: pair XK_L2 --> VK_AGAIN and XK_L1 --> VK_STOP. On both PC and Solaris this will make program to behave as before (buggy on Solaris). Proper fix will be with 5036807 in dolphin. ###@###.### 2005-06-17 12:41:39 GMT
25-05-2005