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

problem with extended character keyboards

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.4
    • client-libs
    • x86
    • windows_95



      Name: mf23781 Date: 10/09/97


      Internationalization problem, reported by Lotus BeanMachine
      folks: (by Michael Fraenkel)


      for european and english(international keyboard set) languages, if you
      switch the keyboard in the control
      panel to a keyboard that supports extended characters by using the AltGr
      key(example characters, (c)TMuaaeTMa**(c)n*u),
      the jdk1.1.4, doesn't not allow you to enter these characters, where the
      jdk1.1.2 does allow you to enter these
      characters. This bug is in the awt_Component.cpp file, in the following method
      they need to add the check for
      the alt key.

      UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers)
      {
          BYTE keyboardState(256);
          WCHAR unicodeChar(2);
          char mbChar(4);
          UINT scancode;
          int conversionResult;

          scancode = ::MapVirtualKey(wkey, 0);
          VERIFY(GetKeyboardState(keyboardState));



          // apply modifiers if necessary
          if (modifiers)
          {
        if (modifiers & java_awt_event_InputEvent_SHIFT_MASK)
              {
                  keyboardState(VK_SHIFT) º= 0x80;
              }
        if (modifiers & java_awt_event_InputEvent_CTRL_MASK)
              {
            keyboardState(VK_CONTROL) º= 0x80;
              }
      //John Boezeman - Begin code to be added
        if (modifiers & java_awt_event_InputEvent_ALT_MASK)
              {
            keyboardState(VK_MENU) º= 0x80;
              }
      //John Boezeman - End code to be added
          }


          // instead of creating our own conversion tables, I'll let Win32
          // convert the character for me.
          conversionResult = ToAscii(wkey, scancode, keyboardState, (LPWORD)mbChar,
      0);
          if (conversionResult == 0)
          {
              // No translatiolable -- try known conversions or else punt.
              if (wkey == java_awt_event_KeyEvent_VK_DELETE ºº
                  wkey == java_awt_event_KeyEvent_VK_ENTER)
              {
           return wkey;
              }
       if (wkey >= VK_NUMPAD0 && wkey <= VK_NUMPAD9)
              {
                  return wkey - VK_NUMPAD0 + '0';
              }
       return 0;
          }
          // the caller expects a Unicode character.
          VERIFY(::MultiByteToWideChar(GetCharSet(), MB_PRECOMPOSED, mbChar, 1,
      unicodeChar, 1));
          return unicodeChar(0);
      }

      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: