Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4638298

KeyEvent.VK_INPUT_METHOD_ON_OFF should on/off Korean Input Method.

XMLWordPrintable

    • Fix Understood
    • x86
    • windows_xp



      Name: jk109818 Date: 02/14/2002


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

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      ADDITIONAL OPERATING SYSTEMS :
      Korean Version


      A DESCRIPTION OF THE PROBLEM :
      KeyEvent.VK_INPUT_METHOD_ON_OFF should on/off Korean Input
      Method.
      In JVM on Korean OS, KeyEvent.VK_INPUT_METHOD_ON_OFF is
      interpreted as on/off Korean <-> Chinese Character.
      But, It's not a we want.

      An article in Bug parade
      (http://developer.java.sun.com/developer/bugParade/bugs/4267564.html)
      described that Nihongo Key in Japanese keyboard and Hanja
      key in Korean keyboard have the same function, but it's not
      a truth.
      Actually, Nihongo Key in Japanese keyboard and Hangul key in
      Korean keyboard are the same.

      The problem of this bug is that Korean programmer can't make
      a Automated UI testing program using java.awt.Robot.
      Robot's keyPress(), keyRelease() methods are good. But, due
      to the wrong definition of KeyEvent.VK_INPUT_METHOD_ON_OFF,
      Robot can't generate Korean Charanter.






      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Write program using java.awt.Robot
      2. use "keyPress(KeyEvent.VK_INPUT_METHOD_ON_OFF)"
       and "keyRelease(KeyEvent.VK_INPUT_METHOD_ON_OFF)"
      3. use "keyPress(KEYEvent.VK_R)" and
      "keyRelease(KEYEvent.VK_K)" (or use "VK_K" and "VK_F" in
      3_beolsik_keyboard)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      java.awt.Robot should on/off Korean Input Method.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /**
       * This test code must generate Korean character pronounced by 'ga',
       * but due to the wrong definition of KeyEvent.VK_INPUT_METHOD_ON_OFF,
       * the result is "rk"
       */
      import java.awt.*;
      import java.awt.event.*;

      public class RobotTest extends Frame
      {
          TextField tf;
          Robot robot;

          public RobotTest()
          {
              super("RobotTest");
              tf=new TextField(10);
              add(tf);
          }

          void setRobot() throws AWTException
          {
              robot=new Robot();
              robot.setAutoDelay(250);

              Point point=tf.getLocationOnScreen();

              robot.mouseMove(point.x+10, point.y+10);
              robot.mousePress(MouseEvent.BUTTON1_MASK);
              robot.mouseRelease(MouseEvent.BUTTON1_MASK);

              robot.keyPress(KeyEvent.VK_INPUT_METHOD_ON_OFF);
              robot.keyRelease(KeyEvent.VK_INPUT_METHOD_ON_OFF);
              robot.keyPress(KeyEvent.VK_R);
              robot.keyRelease(KeyEvent.VK_R);
              robot.keyPress(KeyEvent.VK_K);
              robot.keyRelease(KeyEvent.VK_K);
              robot.delay(1000);
          }

          public static void main(String[] args) throws AWTException
          {
              RobotTest f=new RobotTest();
              f.setSize(100, 50);
              f.setVisible(true);
              f.setRobot();
          }
      }
      ---------- END SOURCE ----------
      (Review ID: 139696)
      ======================================================================

            yan Yuri Nesterenko
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: