Hi. I don know if I’m missing something but is there a RegisterCallback to an event that detects a button press that is not device specific? Right now I’m doing this to to get button input from mouse and keyboard/gamepad
protected override void RegisterButtonCallbacks()
{
button.RegisterCallback<ClickEvent>(ClickButton);
button.RegisterCallback<NavigationSubmitEvent>(SubmitButton);
}
void ClickButton(ClickEvent evt)
{
ButtonPress();
}
void SubmitButton(NavigationSubmitEvent evt)
{
ButtonPress();
}
void ButtonPress()
{
myEvents.MenuShown?.Invoke();
}
Seems like a pain to do this for every button. Is there not a way to detect a button press with just one RegisterCallback and then need to only write one method for the event like this?
protected override void RegisterButtonCallbacks()
{
button.RegisterCallback<SomePressedEvent>(ClickButton);
}
void ClickButton(SomePressedEvent evt)
{
myEvents.MenuShown?.Invoke();
}
Im more an artist than a programer so I apoligise if I have missed an obvious solution. Thanks