SFML community forums
Help => Window => Topic started by: Pwndja on April 02, 2010, 05:23:17 am
-
I am currently using 6 different keys in my app: [W, S, D, A, Left, Right]
Now when I push them all down they should still all work. But the S key does not registar. I changed the S key to be the X key and then all the keys work. It is only when I us the S key that they all do not work... That is all except the S key works. With the X = S key they all Work and when S = S key they all work except the S key. It is like it just skips the S key statement.
Code example:
while(1)
{
if (App.GetInput().IsKeyDown(sf::Key::W)) //do something
if (App.GetInput().IsKeyDown(sf::Key::S)) //do something ** this does not execute **
if (App.GetInput().IsKeyDown(sf::Key::D)) //do something
if (App.GetInput().IsKeyDown(sf::Key::A)) //do something
if (App.GetInput().IsKeyDown(sf::Key::Left)) //do something
if (App.GetInput().IsKeyDown(sf::Key::Right)) //do something
}
In the above example when I press all the keys: W, S, D, A, Left, Right everything executes except the S key.
But when I do this:
while(1)
{
if (App.GetInput().IsKeyDown(sf::Key::W)) //do something
if (App.GetInput().IsKeyDown(sf::Key::X)) //do something ***X Key Now***
if (App.GetInput().IsKeyDown(sf::Key::D)) //do something
if (App.GetInput().IsKeyDown(sf::Key::A)) //do something
if (App.GetInput().IsKeyDown(sf::Key::Left)) //do something
if (App.GetInput().IsKeyDown(sf::Key::Right)) //do something
}
They all work.
Any Ideas why this might be?
-
Not a problem with SFML. It's how keyboards are designed. Certain keys combos will not work on certain keyboards.
-
Ok thanks. Is there any thing on the web that you might know of which discussions this issue more in-depth? like white pages or anything?
-
Try a search for n-key rollover (http://www.google.ca/search?q=keyboard+n-key+rollover) and take a look at this Wikipedia article (http://en.wikipedia.org/wiki/Rollover_%28key%29).
-
Awesome! Thank you for all the help :D