当前位置: 首页>>代码示例>>C++>>正文


C++ CInterfaceManager::getCaptureKeyboard方法代码示例

本文整理汇总了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();
	}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:19,代码来源:action_handler_edit.cpp

示例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 ||
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:67,代码来源:input_handler_manager.cpp


注:本文中的CInterfaceManager::getCaptureKeyboard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。