How can i add the random jump?

random jump working fine while i press the jump button its come randomly but after finish the one jump other jump took place automatically without pressing jump button.how can i solve this problem.

 code here

using UnityEngine;
using System.Collections;

public class jump: MonoBehaviour {

string[]  animatorparameters = {"jump_01","jump_02"};
protected Animator animator;



void Start () 
	{      

		animator = GetComponent<Animator>();
		
	    }


Void Update(){
         OnJump();

}






void OnJump()
	{
		int randomJumpAnim = Random.Range(0, animatorparameters.Length); // Choose a random parameter from the array
		//animator.SetTrigger (animatorparameters [randomJumpAnim]);
		print (animatorparameters [randomJumpAnim]);
		AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);

		if (stateInfo.IsName("Base Layer.Run"))
		{
			if (Input.GetKey(KeyCode.Space)) 
			{   
			animator.SetTrigger(animatorparameters[randomJumpAnim]);
		        }


		}




}

}

Hello,

May be try to add this condition:

if (stateInfo.IsName("Base Layer.Run"))
{
   if(Input.anyKeyDown){
        if (Input.GetKey(KeyCode.Space)) 
        {   
           animator.SetTrigger(animatorparameters[randomJumpAnim]);
        }
 
 
    }

}

regards