Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#405 Can't input chinese characters

open
nobody
None
5
2012-03-21
2012-03-21
sucan
No

Console 2.00.148
I foud a solution:
File: ConsoleView.cpp
Code:
BOOL ConsoleView::PreTranslateMessage(MSG* pMsg)
{

if ((pMsg->message == WM_KEYDOWN) ||

(pMsg->message == WM_KEYUP) ||

(pMsg->message == WM_SYSKEYDOWN) ||

(pMsg->message == WM_SYSKEYUP))
{

// Avoid calling ::TranslateMessage for WM_KEYDOWN, WM_KEYUP,

// WM_SYSKEYDOWN and WM_SYSKEYUP (except for wParam == VK_PACKET,

// which is sent by SendInput when pasting text).

///

// This prevents WM_CHAR and WM_SYSCHAR messages, enabling stuff like

// handling 'dead' characters input and passing all keys to console.

if (pMsg->wParam == VK_PACKET) return FALSE;

//::DispatchMessage(pMsg); //原代码行

//添加输入中文功能: begin

::TranslateMessage(pMsg);

if(!::PeekMessage(pMsg, NULL, 0, 0, PM_NOREMOVE))

::DispatchMessage(pMsg);

//添加输入中文功能: end

return TRUE;
}
return FALSE;
}

Thanks!

Discussion

  • sucan
    sucan
    2012-03-21

    • summary: Can't input chinese word --> Can't input chinese characters