Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Fix menu option navigation issue #279

Closed
wants to merge 5 commits into from
Closed

Fix menu option navigation issue #279

wants to merge 5 commits into from

Conversation

clostao
Copy link

@clostao clostao commented Jan 3, 2024

Problem

The structure of crossterm::event::KeyEvent is the following:

pub struct KeyEvent {
    pub code: KeyCode,
    pub modifiers: KeyModifiers,
    pub kind: KeyEventKind,
    pub state: KeyEventState,
}

The current implementation is ignoring the field kind. This could lead to issues as the one described at #223. In this other issue you could check similar problems: crossterm-rs/crossterm#797

Solution

The solution is quite simple, keep the same KeyCode filtering but restrict them to only Press kind events.

Cargo.lock Outdated Show resolved Hide resolved
@clostao clostao closed this by deleting the head repository Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants