JDK-4085094 : problem with extended character keyboards
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.4
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-10-09
  • Updated: 1997-11-11
  • Resolved: 1997-11-11
Related Reports
Duplicate :  
Description

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);
}

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

Comments
WORK AROUND Name: mf23781 Date: 10/09/97 ======================================================================
11-06-2004