How to create a countdown counter based off of a Key press.

I have been taking my hand at creating a timer that countsdown when the letter ‘f’ is pressed. I only want it to count down when this letter is pressed, (EDIT: I mean this to mean that it starts a countdown when you click F, and resets either when the timer ends, or the player hits f) because I am creating a timer that when it reaches 0 the light turns off. (: I’ve tried creating a timer, so I will post it up!

private var timeLeft: float = 0;
var totalTime : float = 30;

function Awake(){
timeLeft = totalTime;
}

function Update(){
timeLeft -= Time.deltaTime;	
if(timeLeft < 0)
	{
	light.enabled = false;
			
	}
}

Thank you! (: Also, this is just excerpts from my code, not the entire thing. (:

#pragma strict

private var timeLeft : int = 10;
private var counting : boolean = false;

function Start()
{
	StartCoroutine(CountDown());
}

function Update()
{
	if(Input.GetKeyDown(KeyCode.F))
		counting = !counting;
	if(timeLeft <= 0 && light && light.enabled)
		light.enabled = false;
}

function CountDown()
{
	while(true)
	{
		if(counting && timeLeft > 0)
			timeLeft--;
		yield WaitForSeconds(1);
	}
}

//FOR TESTING PURPOSES
function OnGUI()
{
	GUILayout.Label("Time Remaining - " + timeLeft.ToString() + "

" + “Press ‘F’ Key to toggle timer.”);
}