1
Window / No respond from "sf::Event::KeyPressed" when i press a letter
« on: May 25, 2020, 02:03:28 am »
When i press a letter "sf::Event::KeyPressed" dont work but when i press arrow keys or ctr, alt it is responding.
I'm using Linux: Solus
I'm using Linux: Solus
void Game::processEvents()
{
sf::Event event;
while (mWindow.pollEvent(event));
{
switch (event.type)
{
case sf::Event::KeyPressed:
handlePlayerInput(event.key.code, true);
log("key pressed");
break;
case sf::Event::KeyReleased:
handlePlayerInput(event.key.code, false);
log("key released");
break;
case sf::Event::Closed:
mWindow.close();
break;
}
}
}
{
sf::Event event;
while (mWindow.pollEvent(event));
{
switch (event.type)
{
case sf::Event::KeyPressed:
handlePlayerInput(event.key.code, true);
log("key pressed");
break;
case sf::Event::KeyReleased:
handlePlayerInput(event.key.code, false);
log("key released");
break;
case sf::Event::Closed:
mWindow.close();
break;
}
}
}