It's really easy to create such an array yourself - a couple of lines of code.
std::map<int,bool> keys; // Add this somewhere in a class or where it doesn't get destroyed
// ---
sf::Event event;
while(window.pollEvent(event)) {
switch(event.type) {
case sf::Event::KeyPressed:
keys[event.key.code] = true;
break;
case sf::Event::KeyReleased:
keys[event.key.code] = false;
break;
default:
break;
}
every key's state can be checked with keys[sf::Keyboard:<key>]
It's really easy to create such an array yourself - a couple of lines of code.
std::map<int,bool> keys; // Add this somewhere in a class or where it doesn't get destroyed
// ---
sf::Event event;
while(window.pollEvent(event)) {
switch(event.type) {
case sf::Event::KeyPressed:
keys[event.key.code] = true;
break;
case sf::Event::KeyReleased:
keys[event.key.code] = false;
break;
default:
break;
}
every key's state can be checked with keys[sf::Keyboard:<key>]
Dude I had no idea I could do this. Thanks a ton!