I want the Escape key on the keyboard to perform several things depending on the situation the player is in:
- In the title screen, do nothing (let the menu widget be drawn permanently)
- In game mode, it opens the game’s Main Menu
- When talking to a character in dialog mode, it will just cancel the dialog
- In generic dialog prompts, it’s basically a generic shortcut to the “Cancel” or “Close” buttons
- In character stats display, it will be used as a generic “back” function for multi-page menus
A further challenge is that these situations must all be mutually exclusive, as in - if the player is in dialog mode, pressing Escape should NOT open the Main Menu.
I am currently checking for the Escape key via an Input Event in the PlayerController - with Switch statements.
So my question is, is this the best way to do it or not? Because I am finding it difficult to manage the Blueprint when I dump so many specific checks inside the PlayerController.