Skip to content

Commit

Permalink
fix: fix windows double press and change back horizontal scroll to co…
Browse files Browse the repository at this point in the history
…ntrol modifier
  • Loading branch information
matheuswhite committed Mar 15, 2024
1 parent 6d00d5c commit 8db363c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/command_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use crate::plugin_manager::PluginManager;
use crate::serial::SerialIF;
use crate::text::TextView;
use chrono::Local;
use crossterm::event::{Event, EventStream, KeyCode, KeyEvent, KeyModifiers, MouseEventKind};
use crossterm::event::{
Event, EventStream, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseEventKind,
};
use futures::StreamExt;
use rand::seq::SliceRandom;
use ratatui::layout::{Constraint, Direction, Layout, Rect};
Expand Down Expand Up @@ -92,14 +94,16 @@ impl CommandBar {

match event {
Some(Ok(event)) => match event {
Event::Mouse(mouse_evt) if mouse_evt.modifiers == KeyModifiers::SHIFT => {
Event::Mouse(mouse_evt) if mouse_evt.modifiers == KeyModifiers::CONTROL => {
match mouse_evt.kind {
MouseEventKind::ScrollUp => sender.send(HorizontalScroll(-1)).unwrap(),
MouseEventKind::ScrollDown => sender.send(HorizontalScroll(1)).unwrap(),
_ => {}
}
}
Event::Key(key) => sender.send(Key(key)).unwrap(),
Event::Key(key) if key.kind == KeyEventKind::Press => {
sender.send(Key(key)).unwrap()
}
Event::Mouse(mouse_evt) => match mouse_evt.kind {
MouseEventKind::ScrollUp => sender.send(VerticalScroll(-1)).unwrap(),
MouseEventKind::ScrollDown => sender.send(VerticalScroll(1)).unwrap(),
Expand Down

0 comments on commit 8db363c

Please sign in to comment.