Problem with OnTriggerStay2D and Input

First sorry if my english is not good.

I´m trying to make that when a object with a collider is in the player collider, and the button is pressed, display once a message. But the thing is that sometimes nothing happens, and other times display 3 messages at once. I think the problem is in the input config. But is set as deffault and I cant figure out the problem. The Keyboard works fine.

using UnityEngine;
using System.Collections;

public class TestScript : MonoBehaviour {



	void OnTriggerStay2D(Collider2D coll ){
		
		if (Input.GetButtonUp("Accion")){

			Debug.Log ("x");

		}
		
	}
}

Edit: Input is fine too. The problem must be in the OnTriggerStay2D.

The OnTriggerStay is a bit bugged, yeah. So, what you would rather do is something on the lines of what Koharu said. Just use OnTriggerEnter and OnTriggerExit, drop the OnTriggerStay entirely.

To get the effect of an OnTriggerStay, you just add a bool into the mix.

Pseudocode:
    if OnTriggerEnter {Then: newBoolIntoTheMix = true}
    if OnTriggerExit  {Then: newBoolIntoTheMix = false}

Do you see how this creates an illusion of an ontriggerstay? Now you can just call the input functions on your main update with just a reference to this new bool!

OntriggerStay is called almost every frame if you are on the trigger. So,if you want it to happen just 1 time, I would make a bool, true on start and false after the code is done. Also, you might have children with colliders attached to the object.