src/windows/native/sun/windows/awt_Component.cpp

Print this page




3511         translation = java_awt_event_KeyEvent_CHAR_UNDEFINED;
3512     } else
3513     // No translation available -- try known conversions or else punt.
3514     if (converted == 0) {
3515         if (wkey == VK_DELETE) {
3516             translation = '\177';
3517         } else
3518         if (wkey >= VK_NUMPAD0 && wkey <= VK_NUMPAD9) {
3519             translation = '0' + wkey - VK_NUMPAD0;
3520         } else {
3521             translation = java_awt_event_KeyEvent_CHAR_UNDEFINED;
3522         }
3523     } else
3524     // the caller expects a Unicode character.
3525     if (converted > 0) {
3526         translation = wChar[0];
3527     }
3528     if (ops == SAVE) {
3529         transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
3530                        reinterpret_cast<void*>(static_cast<INT_PTR>(translation)));

3531         deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
3532                        reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));



3533     }
3534 
3535     isDeadKey = deadKeyFlag;
3536     return translation;
3537 }
3538 
3539 MsgRouting AwtComponent::WmKeyDown(UINT wkey, UINT repCnt,
3540                                    UINT flags, BOOL system)
3541 {
3542     // VK_PROCESSKEY is a special value which means
3543     //          "Current IME wants to consume this KeyEvent"
3544     // Real key code is saved by IMM32.DLL and can be retrieved by
3545     // calling ImmGetVirtualKey();
3546     if (wkey == VK_PROCESSKEY) {
3547         return mrDoDefault;
3548     }
3549     MSG msg;
3550     InitMessage(&msg, (system ? WM_SYSKEYDOWN : WM_KEYDOWN),
3551                              wkey, MAKELPARAM(repCnt, flags));
3552 




3511         translation = java_awt_event_KeyEvent_CHAR_UNDEFINED;
3512     } else
3513     // No translation available -- try known conversions or else punt.
3514     if (converted == 0) {
3515         if (wkey == VK_DELETE) {
3516             translation = '\177';
3517         } else
3518         if (wkey >= VK_NUMPAD0 && wkey <= VK_NUMPAD9) {
3519             translation = '0' + wkey - VK_NUMPAD0;
3520         } else {
3521             translation = java_awt_event_KeyEvent_CHAR_UNDEFINED;
3522         }
3523     } else
3524     // the caller expects a Unicode character.
3525     if (converted > 0) {
3526         translation = wChar[0];
3527     }
3528     if (ops == SAVE) {
3529         transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
3530                        reinterpret_cast<void*>(static_cast<INT_PTR>(translation)));
3531         if (deadKeyFlag) {
3532             deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
3533                          reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
3534         } else {
3535             deadKeyFlagTable.remove(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)));
3536         }
3537     }
3538 
3539     isDeadKey = deadKeyFlag;
3540     return translation;
3541 }
3542 
3543 MsgRouting AwtComponent::WmKeyDown(UINT wkey, UINT repCnt,
3544                                    UINT flags, BOOL system)
3545 {
3546     // VK_PROCESSKEY is a special value which means
3547     //          "Current IME wants to consume this KeyEvent"
3548     // Real key code is saved by IMM32.DLL and can be retrieved by
3549     // calling ImmGetVirtualKey();
3550     if (wkey == VK_PROCESSKEY) {
3551         return mrDoDefault;
3552     }
3553     MSG msg;
3554     InitMessage(&msg, (system ? WM_SYSKEYDOWN : WM_KEYDOWN),
3555                              wkey, MAKELPARAM(repCnt, flags));
3556