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
ファイル: BaseInput.cpp プロジェクト: aronarts/FireNET
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;
}