I'm having trouble getting keyboard events to work. Please don't say refer to the tutorials, I've looked them over hundreds of times at this point. For now all I want to happen is when I hit space it a statement cout's. What am I missing?
// in InputManager.h
sf::Event mEvent;
//in InputManager.cpp
while (Game::getInstance()->getGraphicsSystem()->pollEvent(mEvent))
{
if (mEvent.type == sf::Event::KeyPressed)
{
if (mEvent.key.code == sf::Keyboard::Space)
{
std::cout << "the space key was pressed" << std::endl;
}
}
}
//the poll event
bool GraphicsSystem::pollEvent(sf::Event theEvent)
{
return mWindow.pollEvent(theEvent);
}