bool CUIActorMenu::OnKeyboard(int dik, EUIMessages keyboard_action)
{
/*
	if (UIPropertiesBox.GetVisible())
	{	UIPropertiesBox.OnKeyboard(dik, keyboard_action); }
*/
	InfoCurItem( NULL );
	if ( is_binded(kDROP, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action && CurrentIItem() && !CurrentIItem()->IsQuestItem() )
		{

			SendEvent_Item_Drop		(CurrentIItem(), m_pActorInvOwner->object_id());
			SetCurrentItem			(NULL);
		}
		return true;
	}
	
	if ( is_binded(kSPRINT_TOGGLE, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action )
		{
			OnPressUserKey();
		}
		return true;
	}	
	
	if ( is_binded(kUSE, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action )
		{
			GetHolder()->StartStopMenu( this, true );
		}
		return true;
	}	

	if( inherited::OnKeyboard(dik,keyboard_action) )return true;

	return false;
}
Example #2
0
void CUISequencer::IR_OnKeyboardPress	(int dik)
{
	if(m_items.size())	m_items.front()->OnKeyboardPress			(dik);
	
	bool b = true;
	if(m_items.size()) b &= m_items.front()->AllowKey(dik);

	if(b && is_binded(kQUIT, dik) )
	{
		Stop		();
		return;
	}

	if(b&&!GrabInput()&&m_pStoredInputReceiver)	
		m_pStoredInputReceiver->IR_OnKeyboardPress	(dik);
}
Example #3
0
void	CMainMenu::IR_OnKeyboardPress(int dik)
{
	if(!IsActive()) return;

	if( is_binded(kCONSOLE, dik) )
	{
		Console->Show();
		return;
	}
	if (DIK_F12 == dik){
		Render->Screenshot();
		return;
	}

	CDialogHolder::IR_UIOnKeyboardPress(dik);
};