本文整理汇总了C++中CGUI::ProcessCharacter方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUI::ProcessCharacter方法的具体用法?C++ CGUI::ProcessCharacter怎么用?C++ CGUI::ProcessCharacter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUI
的用法示例。
在下文中一共展示了CGUI::ProcessCharacter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMessage
bool CLocalGUI::ProcessMessage ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
CGUI* pGUI = CCore::GetSingleton ().GetGUI ();
// If we have the focus, we handle the message
if ( InputGoesToGUI () )
{
// Pass the message to the GUI manager
// ACHTUNG: fix the CEGUI ones!
switch ( uMsg )
{
case WM_MOUSEWHEEL:
if ( GET_WHEEL_DELTA_WPARAM ( wParam ) > 0 )
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEWHEEL, 1, NULL );
else
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEWHEEL, 0, NULL );
return true;
case WM_MOUSEMOVE:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEPOS, LOWORD ( lParam ), HIWORD ( lParam ) );
return true;
case WM_LBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, LeftButton );
return true;
case WM_RBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, RightButton );
return true;
case WM_MBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, MiddleButton );
return true;
case WM_LBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, LeftButton );
return true;
case WM_RBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, RightButton );
return true;
case WM_MBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, MiddleButton );
return true;
#ifdef WM_XBUTTONDOWN
case WM_XBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, X1Button );
return true;
case WM_XBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, X1Button );
return true;
#endif
case WM_KEYDOWN:
{
DWORD dwTemp = TranslateScanCodeToGUIKey ( wParam );
if ( dwTemp > 0 )
{
pGUI->ProcessKeyboardInput ( dwTemp, true );
return true;
}
return true;
}
case WM_KEYUP:
{
DWORD dwTemp = TranslateScanCodeToGUIKey ( wParam );
if ( dwTemp > 0 )
{
pGUI->ProcessKeyboardInput ( dwTemp, false );
}
return false;
}
case WM_CHAR:
pGUI->ProcessCharacter ( wParam );
return true;
}
}
// Test - Use PageUp and PageDown to scroll chat box
switch ( uMsg )
{
case WM_KEYDOWN:
{
if ( wParam == VK_PRIOR )
{
if ( m_pChat )
m_pChat->ScrollUp ();
if ( m_pDebugView )
m_pDebugView->ScrollUp ();
}
else
if ( wParam == VK_NEXT )
{
if ( m_pChat )
//.........这里部分代码省略.........
示例2: ProcessMessage
bool CLocalGUI::ProcessMessage ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
CGUI* pGUI = CCore::GetSingleton ().GetGUI ();
// If we have the focus, we handle the message
if ( InputGoesToGUI () )
{
// Pass the message to the GUI manager
// ACHTUNG: fix the CEGUI ones!
switch ( uMsg )
{
case WM_MOUSEWHEEL:
if ( GET_WHEEL_DELTA_WPARAM ( wParam ) > 0 )
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEWHEEL, 1, NULL );
else
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEWHEEL, 0, NULL );
return true;
case WM_MOUSEMOVE:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEPOS, LOWORD ( lParam ), HIWORD ( lParam ) );
return true;
case WM_LBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, LeftButton );
return true;
case WM_RBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, RightButton );
return true;
case WM_MBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, MiddleButton );
return true;
case WM_LBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, LeftButton );
return true;
case WM_RBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, RightButton );
return true;
case WM_MBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, MiddleButton );
return true;
#ifdef WM_XBUTTONDOWN
case WM_XBUTTONDOWN:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEDOWN, 0, 0, X1Button );
return true;
case WM_XBUTTONUP:
pGUI->ProcessMouseInput ( CGUI_MI_MOUSEUP, 0, 0, X1Button );
return true;
#endif
case WM_KEYDOWN:
{
DWORD dwTemp = TranslateScanCodeToGUIKey ( wParam );
if ( dwTemp > 0 )
{
pGUI->ProcessKeyboardInput ( dwTemp, true );
return true;
}
return true;
}
case WM_KEYUP:
{
DWORD dwTemp = TranslateScanCodeToGUIKey ( wParam );
if ( dwTemp > 0 )
{
pGUI->ProcessKeyboardInput ( dwTemp, false );
}
return false;
}
case WM_IME_COMPOSITION:
{
if ( lParam & GCS_RESULTSTR )
{
HIMC himc = ImmGetContext ( hwnd );
// Get composition result
ushort buffer[256];
LONG numBytes = ImmGetCompositionStringW ( himc, GCS_RESULTSTR, buffer, sizeof ( buffer ) - 2 );
int iNumCharacters = numBytes / sizeof ( ushort );
// Erase output from previous composition state
for ( int i = 0 ; i < m_uiActiveCompositionSize ; i++ )
{
pGUI->ProcessCharacter ( '\x08' );
pGUI->ProcessKeyboardInput ( 14, true );
}
// Output composition result
for ( int i = 0 ; i < iNumCharacters ; i++ )
if ( buffer[i] )
pGUI->ProcessCharacter ( buffer[i] );
//.........这里部分代码省略.........