JDK-4347983 : InvalidKeyCode exception was thrown when keys like At, plus pressed by Robot.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0,1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,solaris_7
  • CPU: x86,sparc
  • Submitted: 2000-06-24
  • Updated: 2001-03-08
  • Resolved: 2000-07-25
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 Other
1.3.1 rc1Fixed 1.4.0Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
In Windows & Solaris Invalid KeyCode Exception was thrown when
    			KeyPressed was done for following keys.
		
		a)Exclamation Mark
		b)At
		c)Number Sign
		d)Dollar
		e)Circumflex
		f)Ampersand
		g)Asterisk
		h)Left Parenthesis
		i)Right Parenthesis
		j)Underscore
		k)Plus
		l)Left Brace
		m)Right Brace
		n)Colon
		o)Double Quote
		p)Less
		q)Greater

How to reproduce the Bug? -------->
Run this sample code. You would see a frame with a red Canvas.This is an automated test. No user interaction allowed.The robot will press the above mentioned keys.	If key events are triggered, the message will be displayed
on the text area.

    If Invalid Key Code Exception is thrown, the bug is reproduced.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: ladybird-rc1 merlin-beta FIXED IN: ladybird-rc1 merlin-beta INTEGRATED IN: ladybird-rc1 merlin-beta VERIFIED IN: merlin-beta
14-06-2004

SUGGESTED FIX sccs diffs -C canvas.c ------- canvas.c ------- *** /tmp/dKUaOjV Fri Jun 30 10:52:41 2000 --- canvas.c Thu Jun 29 18:57:25 2000 *************** *** 142,148 **** {java_awt_event_KeyEvent_VK_PAUSE, XK_Pause, FALSE}, {java_awt_event_KeyEvent_VK_CAPS_LOCK, XK_Caps_Lock, FALSE}, {java_awt_event_KeyEvent_VK_ESCAPE, XK_Escape, TRUE}, - {java_awt_event_KeyEvent_VK_SPACE, XK_space, TRUE}, {java_awt_event_KeyEvent_VK_PAGE_UP, XK_Page_Up, FALSE}, {java_awt_event_KeyEvent_VK_PAGE_UP, XK_R9, FALSE}, --- 142,147 ---- *************** *** 178,195 **** {java_awt_event_KeyEvent_VK_8, XK_8, TRUE}, {java_awt_event_KeyEvent_VK_9, XK_9, TRUE}, ! {java_awt_event_KeyEvent_VK_EQUALS, XK_equal, TRUE}, ! {java_awt_event_KeyEvent_VK_BACK_SLASH, XK_backslash, TRUE}, ! {java_awt_event_KeyEvent_VK_BACK_QUOTE, XK_grave, TRUE}, ! {java_awt_event_KeyEvent_VK_OPEN_BRACKET, XK_bracketleft, TRUE}, ! {java_awt_event_KeyEvent_VK_CLOSE_BRACKET, XK_bracketright, TRUE}, ! {java_awt_event_KeyEvent_VK_SEMICOLON, XK_semicolon, TRUE}, {java_awt_event_KeyEvent_VK_QUOTE, XK_apostrophe, TRUE}, {java_awt_event_KeyEvent_VK_COMMA, XK_comma, TRUE}, {java_awt_event_KeyEvent_VK_MINUS, XK_minus, TRUE}, {java_awt_event_KeyEvent_VK_PERIOD, XK_period, TRUE}, {java_awt_event_KeyEvent_VK_SLASH, XK_slash, TRUE}, {java_awt_event_KeyEvent_VK_NUMPAD0, XK_KP_0, TRUE}, {java_awt_event_KeyEvent_VK_NUMPAD1, XK_KP_1, TRUE}, {java_awt_event_KeyEvent_VK_NUMPAD2, XK_KP_2, TRUE}, --- 177,218 ---- {java_awt_event_KeyEvent_VK_8, XK_8, TRUE}, {java_awt_event_KeyEvent_VK_9, XK_9, TRUE}, ! {java_awt_event_KeyEvent_VK_SPACE, XK_space, TRUE}, ! {java_awt_event_KeyEvent_VK_EXCLAMATION_MARK, XK_exclam, TRUE}, ! {java_awt_event_KeyEvent_VK_QUOTEDBL, XK_quotedbl, TRUE}, ! {java_awt_event_KeyEvent_VK_NUMBER_SIGN, XK_numbersign, TRUE}, ! {java_awt_event_KeyEvent_VK_DOLLAR, XK_dollar, TRUE}, ! {java_awt_event_KeyEvent_VK_AMPERSAND, XK_ampersand, TRUE}, {java_awt_event_KeyEvent_VK_QUOTE, XK_apostrophe, TRUE}, + {java_awt_event_KeyEvent_VK_LEFT_PARENTHESIS, XK_parenleft, TRUE}, + {java_awt_event_KeyEvent_VK_RIGHT_PARENTHESIS, XK_parenright, TRUE}, + {java_awt_event_KeyEvent_VK_ASTERISK, XK_asterisk, TRUE}, + {java_awt_event_KeyEvent_VK_PLUS, XK_plus, TRUE}, {java_awt_event_KeyEvent_VK_COMMA, XK_comma, TRUE}, {java_awt_event_KeyEvent_VK_MINUS, XK_minus, TRUE}, {java_awt_event_KeyEvent_VK_PERIOD, XK_period, TRUE}, {java_awt_event_KeyEvent_VK_SLASH, XK_slash, TRUE}, + {java_awt_event_KeyEvent_VK_COLON, XK_colon, TRUE}, + {java_awt_event_KeyEvent_VK_SEMICOLON, XK_semicolon, TRUE}, + {java_awt_event_KeyEvent_VK_LESS, XK_less, TRUE}, + {java_awt_event_KeyEvent_VK_EQUALS, XK_equal, TRUE}, + {java_awt_event_KeyEvent_VK_GREATER, XK_greater, TRUE}, + + {java_awt_event_KeyEvent_VK_AT, XK_at, TRUE}, + + {java_awt_event_KeyEvent_VK_OPEN_BRACKET, XK_bracketleft, TRUE}, + {java_awt_event_KeyEvent_VK_BACK_SLASH, XK_backslash, TRUE}, + {java_awt_event_KeyEvent_VK_CLOSE_BRACKET, XK_bracketright, TRUE}, + {java_awt_event_KeyEvent_VK_CIRCUMFLEX, XK_asciicircum, TRUE}, + {java_awt_event_KeyEvent_VK_UNDERSCORE, XK_underscore, TRUE}, + {java_awt_event_KeyEvent_VK_BACK_QUOTE, XK_grave, TRUE}, + + {java_awt_event_KeyEvent_VK_BRACELEFT, XK_braceleft, TRUE}, + {java_awt_event_KeyEvent_VK_BRACERIGHT, XK_braceright, TRUE}, + + {java_awt_event_KeyEvent_VK_INVERTED_EXCLAMATION_MARK, XK_exclamdown, TRUE}, + {java_awt_event_KeyEvent_VK_NUMPAD0, XK_KP_0, TRUE}, {java_awt_event_KeyEvent_VK_NUMPAD1, XK_KP_1, TRUE}, {java_awt_event_KeyEvent_VK_NUMPAD2, XK_KP_2, TRUE},
11-06-2004

EVALUATION None of the listed keys are on the primary layer. Probably not a bug. Note that the Exception thrown is a java.lang.IllegalArgumentException, not an InvalidKeyCodeException. eric.hawkes@eng 2000-06-26 It is possible to fix this on Solaris simply by adding the keycodes to the translation table in canvas.c. The same fix will not work for windows, since the key event model used by windows is fundamentally different than that used by X/Motif. Note: this test will not pass on Windows, and I don't think it is desirable to make it pass, unless the user is using a keyboard that has these keys on the primary layer. eric.hawkes@eng 2000-06-30 I tested my fix with a German keyboard, using the en_US locale. The keyboard has the following four keys on the primary layer # + < ^ They were all translated correctly. I also tested my fix with a Japanese keyboard in the ja locale. The keyboard has the following three keys on the primary layer @ ^ : They were all translated correctly. See bugid 4295215. eric.hawkes@eng 2000-07-12
12-07-2000