Hello I've recently been learning to use multiple threads and using sf::Keyboard for unbuffered input. The issue I'm running into is that when I press A with the following code it doesn't run the what's within the if block.
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Key::A)) { // Returns false
message_out += "a";
std::cout << "WORKED";
}
But when trying this it works properly and prints "WORKED"
bool test = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::A); // Returns true
if (test == true) {
message_out += "a";
std::cout << "WORKED";
}
Is this an issue with threads or a bug?