Two keys should always be available for the player to quit your game gracefully, the ESC key and the ALT + F4 combo.
Why: ESC and ALT + F4 are expected to be available when using any Windows application.
ESC key
- When pressed the player is prompted for confirmation that they want to exit
- While the confirmation prompt is displayed, the player can press ESC to cancel the exit action and go back to the previous mode they were in
- The ENTER key and the SPACE key (when pressed) confirms that the player wants to exit and the game immediately quits
ALT + F4 key combo
- When pressed together the game should exit without prompting the player
Exceptions:
- If your game has only one mode i.e. gameplay (and no menus) then it should be safe to use ESC without prompting the player for confirmation.
Notes:
I’ve only covered the basics here, I’ve omitted how to handle saving game state and how to use the mouse to exit the game. If you don’t have the basics implemented, chances are you’re doing something wrong.

