Sign in to follow this  
Stormtrooper

[Guichan] Cannot compare gcn::Key?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this