Complete the code to check if the space key is currently held down.
if (Input.[1](KeyCode.Space)) { Debug.Log("Space key is held down."); }
Input.GetKey returns true as long as the key is held down.
Complete the code to detect when the player just pressed the 'W' key this frame.
if (Input.[1](KeyCode.W)) { Debug.Log("W key was just pressed."); }
Input.GetKeyDown returns true only on the frame the key is first pressed.
Fix the error in the code to detect when the 'Escape' key is released.
if (Input.[1](KeyCode.Escape)) { Debug.Log("Escape key was released."); }
Input.GetKeyUp returns true on the frame the key is released.
Fill both blanks to create a dictionary that maps keys to whether they were just pressed this frame.
var keysPressed = new Dictionary<KeyCode, bool> {
{ KeyCode.A, Input.[1](KeyCode.A) },
{ KeyCode.D, Input.[2](KeyCode.D) }
};Use GetKeyDown to check if keys were just pressed this frame.
Fill all three blanks to create a dictionary that maps keys to whether they are held down or just released.
var keyStates = new Dictionary<KeyCode, bool> {
{ KeyCode.LeftArrow, Input.[1](KeyCode.LeftArrow) },
{ KeyCode.RightArrow, Input.[2](KeyCode.RightArrow) },
{ KeyCode.UpArrow, Input.[3](KeyCode.UpArrow) }
};GetKey checks if a key is held down, GetKeyUp checks if it was just released.