Commit 013214899a

013214899ac5ab3fcc42a08ead0f3ca951db077c

parent: 8a5049fb25

Unregistered key

Ulyssa <git@ulyssa.dev> · 2024-03-21 05:13 UTC
committer: <noreply@github.com>

Ignore key releases on platforms that support it (#220)

Layout: unified · split

src/main.rs +8 −1
@@ -46,6 +46,7 @@ use modalkit::crossterm::{
4646 EnableBracketedPaste,
4747 EnableFocusChange,
4848 Event,
49 KeyEventKind,
4950 },
5051 execute,
5152 terminal::{EnterAlternateScreen, LeaveAlternateScreen, SetTitle},
@@ -341,7 +342,13 @@ impl Application {
341342 }
342343
343344 match read()? {
344 Event::Key(ke) => return Ok(ke.into()),
345 Event::Key(ke) => {
346 if ke.kind == KeyEventKind::Release {
347 continue;
348 }
349
350 return Ok(ke.into());
351 },
345352 Event::Mouse(_) => {
346353 // Do nothing for now.
347354 },