Jump to content
  • Advertisement
Sign in to follow this  
Stormtrooper

[Guichan] Cannot compare gcn::Key?

This topic is 4001 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to make it so the user can bind keys to commands (using boost::function, and the commands be functions. No large switch() statements here). I am trying to check to see if the key is equal to the key in the list of commands.
void GameManager::keyReleased( gcn::KeyEvent &keyEvent )
{
	std::list<CommandList>::const_iterator iter;

	for( iter = m_commandList.begin(); iter != m_commandList.end(); ++iter )
	{
		if( iter->key == keyEvent.getKey() )
		{
			iter->function();
		}
        }
}
There error is the if statement. error C2678: binary '==' : no operator found which takes a left-hand operand of type 'const gcn::Key' (or there is no acceptable conversion) 1> C:\Program Files\Microsoft Platform SDK\Include\guiddef.h(192): could be 'int operator ==(const GUID &,const GUID &)' 1> while trying to match the argument list '(const gcn::Key, const gcn::Key)'

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!