I created a custom button so that the right click is differentiated from the left
public class CustomButton : Selectable
{
[SerializeField]
private Button.ButtonClickedEvent m_OnLeftClick = new Button.ButtonClickedEvent();
[SerializeField]
private Button.ButtonClickedEvent m_OnRightClick = new Button.ButtonClickedEvent();
public Button.ButtonClickedEvent onLeftClick
{
get
{
return this.m_OnLeftClick;
}
set
{
this.m_OnLeftClick = value;
}
}
public Button.ButtonClickedEvent onRightClick
{
get
{
return this.m_OnRightClick;
}
set
{
this.m_OnRightClick = value;
}
}
I add these buttons in a menu with a GridLayoutGroup.
When I try to navigate using keyboard I can’t do it
As seen in the image, navigation is activated and is recognized by unity. If I try to add classic buttons to this same GridLayoutGroup. These do allow me to navigate
I saw in the Button code in unity add these interfaces IPointerClickHandler, ISubmitHandler, IEventSystemHandler, try to do the test so that it is public class CustomButton : Selectable,IPointerClickHandler, ISubmitHandler, IEventSystemHandler but it still does not navigate.
With the mouse everything works perfectly.




