Skip to content

Fix ExitOnEscape behavior inconsistency in input management tutorial #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

AristurtleDev
Copy link
Contributor

@AristurtleDev AristurtleDev commented Jul 25, 2025

Description

This pull request addresses community feedback regarding missing ExitOnEscape functionality after following the input management tutorial, where removing the old input handling code inadvertently disabled the escape key exit behavior.

Resolves: Issue #142

Changes Made

Updated the input management tutorial to maintain consistent ExitOnEscape behavior by:

  • Added ExitOnEscape initialization in Core constructor: Set ExitOnEscape = true; in the Core.cs constructor to mimic the default MonoGame template behavior
  • Removed outdated input handling code: Eliminated the legacy GamePad.GetState() and Keyboard.GetState().IsKeyDown(Keys.Escape) checks from all Game1.cs snippet files throughout the tutorial

@SimonDarksideJ SimonDarksideJ merged commit 14acbb1 into MonoGame:main Jul 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial error: ExitOnEscape logic not triggered as expected in “Building 2D Games”
2 participants