bool m_down = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::M);
bool up_down = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Up);
bool down_down = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Down);
bool left_down = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Left);
bool right_down = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Right);
This code is basically the only relevant code.
When I’m holding some other keys as the same time as M and a[n] arrow key[s], it seems to return false on m being pressed. (Even though it is)
I have no code manipulating it, breaking, etc, and would like some insight into why this is occurring if possible, and how to fix it.
If there is no way of fixing it, then can you advise me the best way to remake this function on my side using the event system?
As per the comments, this link here explains that there is an inherent limitation of the keyboard. Most keyboards can only only register a certain number of key presses at any given time, and ignore any subsequent key presses until you release one or more of the current keys. This doesn’t apply to modifier keys (like Ctrl, alt, and shift) as those keys are treated specially (since they were intended to be used in tandem with other keys).