Skip to content

Commit

Permalink
fix: double input on windows(ckaznable#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
non-descriptive committed May 31, 2023
1 parent 84a1fcc commit ea42716
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/keybinding.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, KeyEventKind};
use tui_input::backend::crossterm::EventHandler;

use crate::{AppState, InputMode};

static PAGE_NUM: u8 = 4;

pub fn handle_key(mut app: &mut AppState, event: KeyEvent) -> Option<bool> {
if event.kind == KeyEventKind::Release {
return None
}
// in edit mode
if let InputMode::Editing = app.input_mode {
match event.code {
Expand All @@ -25,7 +28,6 @@ pub fn handle_key(mut app: &mut AppState, event: KeyEvent) -> Option<bool> {

return None;
};

match event {
// handle key with control
KeyEvent {
Expand Down

0 comments on commit ea42716

Please sign in to comment.