bool Button::KeyDown(int theKey)
{
	Component::KeyDown(theKey);

	if(theKey==KEYCODE_RETURN && IsDefaultButton())
	{
		Activate();
		return true;
	}
	else if(theKey==KEYCODE_SPACE && !mKeyDown)
	{
		mKeyDown = true;
		Container *aParent = GetParent();
		if(aParent!=NULL)
			aParent->SetHasUsedDialogKeys(true);

		ButtonDown();	
		return true;
	}
	else if(IsRadio())
	{
		bool forward;
		if(theKey==KEYCODE_UP || theKey==KEYCODE_LEFT)
			forward = false;
		else if(theKey==KEYCODE_DOWN || theKey==KEYCODE_RIGHT)
			forward = true;
		else
			return false;

		Container *aParent = GetParent();
		if(aParent!=NULL)
			aParent->SetHasUsedDialogKeys(true);

		Button *aRadio = GetNextRadio(forward);
//		if(aRadio==NULL)
//			aRadio = GetEndRadio(!forward);

		if(aRadio!=NULL)
		{
			aRadio->Activate();
			aRadio->RequestFocus();
		}

		return true;
	}

	return false;
}