Skip to content

Commit

Permalink
Merge pull request #12 from non-descriptive/windows-double-input-fix
Browse files Browse the repository at this point in the history
fix: double input on windows(#10)
  • Loading branch information
ckaznable committed Jun 1, 2023
2 parents 84a1fcc + ea42716 commit 010165d
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 010165d

Please sign in to comment.