< prev index next >

## src/java.desktop/windows/native/libawt/windows/awt_Component.cpp

Print this page

    3520            return static_cast<UINT>(reinterpret_cast<INT_PTR>(value));
    3521        }
    3522     }
    3523
    3524     // If the windows key is a return, wkey will equal 13 ('\r')
    3525     // In this case, we want to return 10 ('\n')
    3526     // Since ToAscii would convert VK_RETURN to '\r', we need
    3527     // to have a special case here.
    3528     if (wkey == VK_RETURN)
    3529         return '\n';
    3530
    3531     // high order bit in keyboardState indicates whether the key is down
    3532     static const BYTE KEY_STATE_DOWN = 0x80;
    3533     BYTE    keyboardState[AwtToolkit::KB_STATE_SIZE];
    3534     AwtToolkit::GetKeyboardState(keyboardState);
    3535
    3536     // apply modifiers to keyboard state if necessary
    3537     BOOL shiftIsDown = FALSE;
    3538     if (modifiers) {
    3539         shiftIsDown = modifiers & java_awt_event_InputEvent_SHIFT_DOWN_MASK;
    3540         BOOL altIsDown = modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK;

    3541         BOOL ctrlIsDown = modifiers & java_awt_event_InputEvent_CTRL_DOWN_MASK;
    3542
    3543         // Windows treats AltGr as Ctrl+Alt
    3544         if (modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK) {
    3545             altIsDown = TRUE;
    3546             ctrlIsDown = TRUE;
    3547         }
    3548
    3549         if (shiftIsDown) {
    3550             keyboardState[VK_SHIFT] |= KEY_STATE_DOWN;
    3551         }
    3552
    3553         // fix for 4623376,4737679,4501485,4740906,4708221 (4173679/4122715)
    3554         // Here we try to resolve a conflict with ::ToAsciiEx's translating
    3555         // ALT+number key combinations. kdm@sarc.spb.su
    3556         // yan: Do it for navigation keys only, otherwise some AltGr deadkeys fail.
    3557         if( IsNavigationKey(wkey) ) {
    3558             keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
    3559         }
    3560
    3561         if (ctrlIsDown)
    3562         {
    3563             if (altIsDown) {
    3564                 // bugid 4215009: don't mess with AltGr == Ctrl + Alt
    3565                 keyboardState[VK_CONTROL] |= KEY_STATE_DOWN;
    3566             }
    3567             else {
    3520            return static_cast<UINT>(reinterpret_cast<INT_PTR>(value));
    3521        }
    3522     }
    3523
    3524     // If the windows key is a return, wkey will equal 13 ('\r')
    3525     // In this case, we want to return 10 ('\n')
    3526     // Since ToAscii would convert VK_RETURN to '\r', we need
    3527     // to have a special case here.
    3528     if (wkey == VK_RETURN)
    3529         return '\n';
    3530
    3531     // high order bit in keyboardState indicates whether the key is down
    3532     static const BYTE KEY_STATE_DOWN = 0x80;
    3533     BYTE    keyboardState[AwtToolkit::KB_STATE_SIZE];
    3534     AwtToolkit::GetKeyboardState(keyboardState);
    3535
    3536     // apply modifiers to keyboard state if necessary
    3537     BOOL shiftIsDown = FALSE;
    3538     if (modifiers) {
    3539         shiftIsDown = modifiers & java_awt_event_InputEvent_SHIFT_DOWN_MASK;
    3540         BOOL altIsDown = ((modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) ||
    3541                             (modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK));
    3542         BOOL ctrlIsDown = modifiers & java_awt_event_InputEvent_CTRL_DOWN_MASK;

    3543
    3544         if (shiftIsDown) {
    3545             keyboardState[VK_SHIFT] |= KEY_STATE_DOWN;
    3546         }
    3547
    3548         // fix for 4623376,4737679,4501485,4740906,4708221 (4173679/4122715)
    3549         // Here we try to resolve a conflict with ::ToAsciiEx's translating
    3550         // ALT+number key combinations. kdm@sarc.spb.su
    3551         // yan: Do it for navigation keys only, otherwise some AltGr deadkeys fail.
    3552         if( IsNavigationKey(wkey) ) {
    3553             keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
    3554         }
    3555
    3556         if (ctrlIsDown)
    3557         {
    3558             if (altIsDown) {
    3559                 // bugid 4215009: don't mess with AltGr == Ctrl + Alt
    3560                 keyboardState[VK_CONTROL] |= KEY_STATE_DOWN;
    3561             }
    3562             else {

< prev index next >