Skip to content

Use WasKeyJustPressed for ExitOnEscape#120

Open
IvanJoskic wants to merge 3 commits intoMonoGame:3.8.4from
IvanJoskic:remove_is_key_down
Open

Use WasKeyJustPressed for ExitOnEscape#120
IvanJoskic wants to merge 3 commits intoMonoGame:3.8.4from
IvanJoskic:remove_is_key_down

Conversation

@IvanJoskic
Copy link
Copy Markdown

@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.

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.

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.

1 participant