Skip to content
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

Ignore key events of types other than press #267

Merged
merged 2 commits into from
Jan 1, 2024
Merged

Conversation

AmmarAbouZor
Copy link
Owner

@AmmarAbouZor AmmarAbouZor commented Jan 1, 2024

This PR closes #266

Since the version 0.26 of crossterm, two events for each key stroke is emitted on Windows (one for press and the other for release) link, which will be eventually the default behavior on Linux as well. This breaking change led to double key registration on windows.

With the PR:

  • only the keys with the event kind "Press" will be caught and the rest will be ignored.
  • The UI won't be re-rendered when the result not-found from a key press handling is returned.

- Release event is emitted separately on windows since Crossterm 0.26
  and will be the same on Linux eventually
@AmmarAbouZor AmmarAbouZor merged commit f1a391b into main Jan 1, 2024
3 checks passed
@AmmarAbouZor AmmarAbouZor deleted the keyevent_press_only branch January 1, 2024 11:38
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.

windows always repeat typing
1 participant