-- Keyboard Input

local function GetKeyboardInput(step)	
	-- Declare & initialize new control inputs
	local yaw, pitch, boost = 0, 0, 0
	
	-- Key inputs
	local w = Keyboard:IsDown(KEY_W) or Keyboard:IsDown(KEY_UP)
	local a = Keyboard:IsDown(KEY_A) or Keyboard:IsDown(KEY_LEFT)
	local s = Keyboard:IsDown(KEY_S) or Keyboard:IsDown(KEY_DOWN)
	local d = Keyboard:IsDown(KEY_D) or Keyboard:IsDown(KEY_RIGHT)
	local shift = Keyboard:IsDown(KEY_LEFTSHIFT) or Keyboard:IsDown(KEY_RIGHTSHIFT)
		
	-- Update controls
	if yaw == 0 then
		yaw = ((a ~= d) and (d and 1 or -1) or 0)
	end
	if pitch == 0 then
		pitch = ((w ~= s) and (s and -1 or 1) or 0)
	end
	boost = ((UpdateBoost(shift, step) and 1) or 0)
	
	-- Throttle is off during countdown
	if countdownGui.TimerFrame.Visible then
		boost = -1
		yaw = 0
		pitch = 0
	end
	
	-- Set engine input variables	
	engine.BoostInput = boost
	engine.YawInput = yaw
	engine.PitchInput = pitch
end -- GetKeyboardInput()