IInputDevice* CBaseInput::GetDevice(uint16 id, EInputDeviceType deviceType)
{
	for(TInputDevices::const_iterator it = m_inputDevices.begin(); it != m_inputDevices.end(); ++it)
	{
		IInputDevice *pDevice = *it;

		if(id == pDevice->GetDeviceIndex() && pDevice->GetDeviceType() == deviceType)
			return pDevice;
	}

	return NULL;
}
示例#2
0
char CBaseInput::GetInputCharAscii(const SInputEvent& event)
{
	for (TInputDevices::iterator i = m_inputDevices.begin(); i != m_inputDevices.end(); ++i)
	{
		IInputDevice* pInputDevice = (*i);
		CRY_ASSERT(pInputDevice != NULL);
		if (event.deviceType == eIDT_Unknown || pInputDevice->GetDeviceType() == event.deviceType)
		{
			char inputChar = pInputDevice->GetInputCharAscii(event);
			if (inputChar)
			{
				return inputChar;
			}
		}
	}

	return '\0';
}
示例#3
0
SInputSymbol* CBaseInput::LookupSymbol( EInputDeviceType deviceType, int deviceIndex, EKeyId keyId )
{
	for (TInputDevices::iterator i = m_inputDevices.begin(); i != m_inputDevices.end(); ++i)
	{
		IInputDevice *pDevice = *i;
		if (pDevice->GetDeviceType() == deviceType && pDevice->GetDeviceIndex() == deviceIndex)
		{
			return pDevice->LookupSymbol(keyId);
		}
	}

	// if no symbol found try finding it in any device
	for (TInputDevices::iterator i = m_inputDevices.begin(); i != m_inputDevices.end(); ++i)
	{
		IInputDevice *pDevice = *i;
		SInputSymbol *pSym = pDevice->LookupSymbol(keyId);
		if (pSym)
			return pSym;
	}

	return NULL;
}