I have a game over screen that pops up when the player loses.
When it pops up, I immediately focus the restart button so that the player can restart quickly should they wish to.
public void Activate(int score)
{
/* ... */
buttonAndEventsList.FirstOrDefault()?.Item1.Focus();
I noticed that when pressing Enter/Spacebar when a button is focused, it activates the button’s Clicked
event.
I wanted to ask if it is possible to make it so the Clicked
event is activated only when Enter is pressed and not Spacebar, since Spacebar is a button consistently used in my game, and a player might accidently restart instantly upon death.