Skip to content

Use WasKeyJustPressed for ExitOnEscape#120

Merged
SimonDarksideJ merged 3 commits into
MonoGame:3.8.4from
IvanJoskic:remove_is_key_down
May 13, 2026
Merged

Use WasKeyJustPressed for ExitOnEscape#120
SimonDarksideJ merged 3 commits into
MonoGame:3.8.4from
IvanJoskic:remove_is_key_down

Conversation

@IvanJoskic
Copy link
Copy Markdown
Contributor

@IvanJoskic IvanJoskic commented May 9, 2026

Use WasKeyJustPressed instead of IsKeyDown which causes issues in later chapters of the tutorial. Following the tutorial, going from 16-Working-With-Sprite-Fonts to 17-Scenes, we will reach a state that causes the title screen to be skipped on Escape press. A single Esc press exits the game completely instead of going to the title screen.

There is a demo branch on my fork (the changes are in 17-Scenes).

Looking at the source code for 17-Scenes there already is a silent fix for this. But it's unnoticed because the chapters before and the tutorial still use IsKeyDown.

Related PR on docs: MonoGame/docs.monogame.github.io#268

Also snuck in a typo fix.

@SimonDarksideJ SimonDarksideJ merged commit 89f5f94 into MonoGame:3.8.4 May 13, 2026
@IvanJoskic IvanJoskic deleted the remove_is_key_down branch May 13, 2026 12:23
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.

2 participants