本文整理汇总了C++中CInterfaceManager::getCaptureKeyboard方法的典型用法代码示例。如果您正苦于以下问题:C++ CInterfaceManager::getCaptureKeyboard方法的具体用法?C++ CInterfaceManager::getCaptureKeyboard怎么用?C++ CInterfaceManager::getCaptureKeyboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInterfaceManager
的用法示例。
在下文中一共展示了CInterfaceManager::getCaptureKeyboard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
// Init the action manager
void init ()
{
// Get the current edit box
_GroupEdit = NULL;
_LooseSelection = false;
// Get the interface manager
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (pIM)
{
CCtrlBase *basectrl = pIM->getCaptureKeyboard();
if (basectrl)
_GroupEdit = dynamic_cast<CGroupEditBox*>(basectrl);
}
if (_GroupEdit)
_GroupEdit->stopParentBlink();
}
示例2: operator
//.........这里部分代码省略.........
- action still valide when teleported
*/
EditActions.releaseAllKeyNoRunning();
Actions.releaseAllKeyNoRunning();
return;
}
// **** Event Focus
// **** Event Keyboard
if( event == EventKeyDownId ||
event == EventKeyUpId ||
event == EventCharId ||
event == EventStringId)
{
// if not handled, post to Action Manager
if( !pIM->handleEvent( CEventDescriptorKey((const CEventKey &) event) ) )
{
// See if handled by editor
bool handled = false;
if (R2::getEditor().isInitialized()
&& (ClientCfg.R2EDEnabled || R2::getEditor().getCurrentTool())
)
{
handled = R2::getEditor().handleEvent(CEventDescriptorKey((const CEventKey &) event) );
}
if (!handled)
{
// Event from the Keyboard (DOWN KEYS)
if(event == EventKeyDownId)
{
CEventKeyDown* downEvent=(CEventKeyDown*)&event;
if (!pIM->getCaptureKeyboard () || !EditActions.keyPushed (*downEvent))
Actions.keyPushed (*downEvent);
}
// Event from the Keyboard (UP KEYS)
else if(event == EventKeyUpId)
{
CEventKeyUp* upEvent=(CEventKeyUp*)&event;
EditActions.keyReleased (*upEvent);
Actions.keyReleased (*upEvent);
}
}
}
/* if handled, still post released key for the following bug:
- I press 'Z' to go 'forward' before entering chat
- I enter chat, keeping Z pressed
- I release 'Z' in chat (thus handled by pIM->handleEvent())
- the player continue running...
*/
else
{
// don't send keydown to action managers
if(event==EventKeyUpId)
{
CEventKeyUp* upEvent=(CEventKeyUp*)&event;
EditActions.keyReleased (*upEvent);
Actions.keyReleased (*upEvent);
}
}
}
// **** Event Mouse
else if(pIM->getPointer() && _Focus /* && pIM->isMouseHandlingEnabled() */ &&
( event == EventMouseMoveId ||
event == EventMouseDownId ||