Skip to content

fix(app): prevent unpause from 'p' release event - #1

Merged
Hyena0x merged 1 commit into
Hyena0x:mainfrom
dstapl:fix/pause-event-handle
Apr 23, 2026
Merged

fix(app): prevent unpause from 'p' release event#1
Hyena0x merged 1 commit into
Hyena0x:mainfrom
dstapl:fix/pause-event-handle

Conversation

@dstapl

@dstapl dstapl commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix a bug where the program could unpause unexpectedly - after a short delay - when running in Windows CMD.
Windows CMD also sends a key release event (event::KeyEventKind::Release) which was being matched by the KeyCode::Char('p') arm.

Changes

  • Updated the KeyCode::Char('p') match arm so that pausing requires a press event (event::KeyEventKind::Press) to trigger.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-targets --all-features

Notes

I moved the if check inside the match arm to allow for any future key hold behavior. However, this could also be placed directly below the if let statement instead, since the other keys just quit the program.

@Hyena0x
Hyena0x merged commit 9357bb5 into Hyena0x:main Apr 23, 2026
2 checks passed
@Hyena0x

Hyena0x commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution. This is a clean fix for a real cross-platform input bug. Really appreciate it!

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