I’m arranging the UI of my game project inspirating by the Lyra game demo source code by Epic.
I would like the UI buttons could be pressed the UI buttons by the Enter keyboard key.
In the experimental CommonUI plugin I noticed the SCommonButton slate widget doesn’t accept the Enter key:
FReply SCommonButton::OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
{
if (InKeyEvent.GetKey() == EKeys::Enter)
{
return FReply::Unhandled();
}
return SButton::OnKeyDown(MyGeometry, InKeyEvent);
}
FReply SCommonButton::OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
{
if (InKeyEvent.GetKey() == EKeys::Enter)
{
return FReply::Unhandled();
}
return SButton::OnKeyUp(MyGeometry, InKeyEvent);
}
I want not modify the CommonUI plugin source code and I would like to configure the accepted input by that button.
What is the reason that button doesn’t accpet the EKeys::Enter input?