selecting a button by just hovering the mouse over it... how?

I’m making a menu system that makes it possible to use mouse and controller input at the same time, it’s working great until now but I wonder if it’s possible to make a button get selected when the mouse pointer is only hovering over it. This is in order to avoid having two buttons that appear to be selected at the same time (According to the Eventsystem object, in reality only one is being selected, the other one is being “highlighted” by the mouse pointer).

I was thinking of something along these lines of this code:

void Start () 
	{
		eve = GameObject.FindGameObjectWithTag("EventSystem").GetComponent<EventSystem>();
		
	}


	void Update () 
	{

  
		if(eve.IsPointerOverGameObject() && eve.currentSelectedGameObject!= /***highlighted gameobject***/ )
		{
			
		eve.SetSelectedGameObject(/***highlighted gameobject***/);
			
		}
	
	}

The /highlighted gameobject/ thing is the part I don’t know how to obtain, is there a way to retrieve the gameobject button that is being highlighted by the mouse pointer?

Thanks in advance.

You want void OnMouseOver() or void OnMouseEnter() for entering or void OnMouseExit() for exiting of course

just be sure the script that has these methods is attached to the game object that you want to hover over