JDK-4760902 : java.awt.Robot can't generate % character on FRENCH keyboard
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.1,1.4.2
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_nt,windows_xp
  • CPU: x86
  • Submitted: 2002-10-10
  • Updated: 2005-02-10
Related Reports
Relates :  
Relates :  
Description

Name: jk109818			Date: 10/09/2002


FULL PRODUCT VERSION :
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

AND

java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

FULL OPERATING SYSTEM VERSION :
Win NT4 SP6

ADDITIONAL OPERATING SYSTEMS :
WIN 95, LINUX MDK 7.1


EXTRA RELEVANT SYSTEM CONFIGURATION :
JDK 1.4.0 , and JDK 1.4.1 have the same behaviour.

A DESCRIPTION OF THE PROBLEM :
I use a FRENCH keyboard and i want to generate a %
character with Robot.keyPress( int keyCode) method.
In a French keyboard, the % character is in the second line
of letters at the right, near the M key.
Using the KeyDemoEvent Applet, i find keyCode=0 for this
key and so keyPress() doens't work :
java.lang.IllegalArgumentException: Invalid key code
        at java.awt.Robot.checkKeycodeArgument
(Robot.java:249)
        at java.awt.Robot.keyPress(Robot.java:221)
        at RobotSaisieJLP.RobotSaisie.run
(RobotSaisie.java:102)
        at java.lang.Thread.run(Thread.java:536)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.For all keyCode=0; use Applet KeyEventDemo to find these
keys
2.
3.

EXPECTED VERSUS ACTUAL BEHAVIOR :
typing % in a writable object ( java or no : form HTML,
notepad, others applications out of the JVM ...)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
see above

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Robot rob=new Robot();
robot.keyPress( keyCode); // with keyCode=0
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
I have not !
(Review ID: 165503) 
======================================================================

Comments
EVALUATION Robot presses and releases keys: you pass it the keycode you want to press/release, not the character. On the French keyboard, the percent character is generated by pressing shift, u-grave. Since there is no keycode for u-grave in Java, there is no way to generate the percent character on a French keyboard using the Robot. ###@###.### 2002-10-09 Since we would need to add new APIs to accomodate this functionality, I am changing this to an rfe. ###@###.### 2002-10-09
09-10-2002