本文整理汇总了C++中CLTGUICtrl::HandleKeyDown方法的典型用法代码示例。如果您正苦于以下问题:C++ CLTGUICtrl::HandleKeyDown方法的具体用法?C++ CLTGUICtrl::HandleKeyDown怎么用?C++ CLTGUICtrl::HandleKeyDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLTGUICtrl
的用法示例。
在下文中一共展示了CLTGUICtrl::HandleKeyDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleKeyDown
bool CMessageBox::HandleKeyDown(int key, int rep)
{
// XENON: Currently disabled in Xenon builds
#if !defined(PLATFORM_XENON)
if (!m_bVisible) return false;
if (m_eType == LTMB_EDIT)
{
//special handling for right and left arrows so that they may cycle through controls
// when the edit box is not selected
if (m_Dlg.GetSelectedControl() != m_pEdit)
{
if (key == VK_LEFT)
return m_Dlg.OnUp();
if (key == VK_RIGHT)
return m_Dlg.OnDown();
}
if (m_pEdit->HandleKeyDown(key,rep))
{
UpdateEditOK();
return true;
}
}
bool handled = false;
switch (key)
{
case VK_LEFT:
case VK_UP:
{
handled = m_Dlg.OnUp();
break;
}
case VK_RIGHT:
case VK_DOWN:
{
handled = m_Dlg.OnDown();
break;
}
case VK_RETURN:
{
handled = m_Dlg.OnEnter();
break;
}
case VK_ESCAPE:
{
if (!m_bIgnoreEsc)
{
Close(false);
handled = true;
}
break;
}
default:
{
if (m_nHotKey > 0 && key == m_nHotKey)
{
Close(true);
handled = true;
}
else
{
CLTGUICtrl* pCtrl = m_Dlg.GetSelectedControl();
if (pCtrl)
handled = pCtrl->HandleKeyDown(key,rep);
else
handled = false;
break;
}
}
}
// Handled the key
return handled;
#else // PLATFORM_XENON
return false;
#endif // PLATFORM_XENON
}