S key not working when down and right are pressed

float moveVertical,
moveHorizontal,
fireVertical,
fireHorizontal;

	fireVertical = 0.0f;
	fireHorizontal = 0.0f;

	moveVertical = 0.0f;
	moveHorizontal = 0.0f;
	
	if(Input.GetKey(KeyCode.W) == true)
		moveVertical = 1.0f;
	if(Input.GetKey(KeyCode.S) == true)
	{
		moveVertical = -1.0f;
		
		Debug.Log("Time: " + Time.time.ToString() + ": S is pressed");
	}
	if(Input.GetKey(KeyCode.D) == true)
		moveHorizontal = -1.0f;
	if(Input.GetKey(KeyCode.A) == true)
		moveHorizontal = 1.0f;
	
	if(Input.GetKey(KeyCode.UpArrow) == true)
		fireVertical += 1.0f;
	if(Input.GetKey(KeyCode.DownArrow) == true)
		fireVertical += -1.0f;
	if(Input.GetKey(KeyCode.LeftArrow) == true)
		fireHorizontal += 1.0f;
	if(Input.GetKey(KeyCode.RightArrow) == true)
		fireHorizontal += -1.0f;

When the down and right arrow keys are held down.
The ‘S’ key does not return true

if(Input.GetKey(KeyCode.S) == true)

What is causing this and how can I fix it?

Edit: W, A, and D work while down and right are pressed. Just not S.

This is probably not a bug with Unity. This is a bug with… your keyboard! This is called “Keyboard Ghosting”.

A lot of keyboards have a maximum number of keys that can be pressed at the same time. Because manufacturers try to keep costs low, you can often not assume that three keys can be pressed at the same time. From what I’ve seen, and my experience, laptop keyboards are often bigger sinners than separate keyboards.

Open this web page, and try out the demo. You’ll probably not be able to register down, right and S at the same time.

The solution? On your side, you could buy a new keyboard. If you want to sell your game, though… you have some choices, and none of them are ideal:

1: Don’t make a game where you ever have to press three keyboard keys at the same time. If I knew of a list of what keyboard combinations worked on the majority of keyboards, I’d be overjoyed. We’ve just resolved to go with this.

2: Make your game for controllers, and put one of those big “Best played on controllers” splash screen on startup. Allow players to rebind keys for configurations that work for their keyboard. You’ll get some angry emails and bad reviews from people with the wrong keyboards.

3: Ignore it. Get a lot of angry emails.

4: Only release for consoles.