3836 3837 if (unicodeChar == VK_RETURN) { 3838 // Enter key generates \r in windows, but \n is required in java 3839 unicodeChar = java_awt_event_KeyEvent_VK_ENTER; 3840 } 3841 MSG msg; 3842 InitMessage(&msg, message, character, 3843 MAKELPARAM(repCnt, flags)); 3844 SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_TYPED, 3845 ::JVM_CurrentTimeMillis(NULL, 0), 3846 java_awt_event_KeyEvent_VK_UNDEFINED, 3847 unicodeChar, modifiers, 3848 java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0, 3849 &msg); 3850 return mrConsume; 3851 } 3852 3853 MsgRouting AwtComponent::WmForwardChar(WCHAR character, LPARAM lParam, 3854 BOOL synthetic) 3855 { 3856 // just post WM_CHAR with unicode key value 3857 DefWindowProc(WM_CHAR, (WPARAM)character, lParam); 3858 return mrConsume; 3859 } 3860 3861 MsgRouting AwtComponent::WmPaste() 3862 { 3863 return mrDoDefault; 3864 } 3865 3866 // support IME Composition messages 3867 void AwtComponent::SetCompositionWindow(RECT& r) 3868 { 3869 HWND hwnd = ImmGetHWnd(); 3870 HIMC hIMC = ImmGetContext(hwnd); 3871 if (hIMC == NULL) { 3872 return; 3873 } 3874 COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}}; 3875 ImmSetCompositionWindow(hIMC, &cf); | 3836 3837 if (unicodeChar == VK_RETURN) { 3838 // Enter key generates \r in windows, but \n is required in java 3839 unicodeChar = java_awt_event_KeyEvent_VK_ENTER; 3840 } 3841 MSG msg; 3842 InitMessage(&msg, message, character, 3843 MAKELPARAM(repCnt, flags)); 3844 SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_TYPED, 3845 ::JVM_CurrentTimeMillis(NULL, 0), 3846 java_awt_event_KeyEvent_VK_UNDEFINED, 3847 unicodeChar, modifiers, 3848 java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0, 3849 &msg); 3850 return mrConsume; 3851 } 3852 3853 MsgRouting AwtComponent::WmForwardChar(WCHAR character, LPARAM lParam, 3854 BOOL synthetic) 3855 { 3856 deadKeyActive = FALSE; 3857 3858 // just post WM_CHAR with unicode key value 3859 DefWindowProc(WM_CHAR, (WPARAM)character, lParam); 3860 return mrConsume; 3861 } 3862 3863 MsgRouting AwtComponent::WmPaste() 3864 { 3865 return mrDoDefault; 3866 } 3867 3868 // support IME Composition messages 3869 void AwtComponent::SetCompositionWindow(RECT& r) 3870 { 3871 HWND hwnd = ImmGetHWnd(); 3872 HIMC hIMC = ImmGetContext(hwnd); 3873 if (hIMC == NULL) { 3874 return; 3875 } 3876 COMPOSITIONFORM cf = {CFS_DEFAULT, {0, 0}, {0, 0, 0, 0}}; 3877 ImmSetCompositionWindow(hIMC, &cf); |