summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorRichard Menzies <52405405+WizardOhio24@users.noreply.github.com>2021-02-23 10:03:50 +0000
committerGitHub <noreply@github.com>2021-02-23 11:03:50 +0100
commit457f644f30b8d78867a8ea28a0dbd4b7c819466f (patch)
treec925a7ddcc302eef3d2c90e70f243c2f08e1627b /src/main.rs
parent6c974ee1d33977cb04e2e8377def291c3beef4ab (diff)
Support mouse scrolling (#306)
Linked to #226
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 47972eae..053fac6c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -35,6 +35,7 @@ use clap::{
};
use crossbeam_channel::{tick, unbounded, Receiver, Select};
use crossterm::{
+ event::{DisableMouseCapture, EnableMouseCapture},
terminal::{
disable_raw_mode, enable_raw_mode, EnterAlternateScreen,
LeaveAlternateScreen,
@@ -167,11 +168,13 @@ fn main() -> Result<()> {
fn setup_terminal() -> Result<()> {
enable_raw_mode()?;
io::stdout().execute(EnterAlternateScreen)?;
+ io::stdout().execute(EnableMouseCapture)?;
Ok(())
}
fn shutdown_terminal() -> Result<()> {
io::stdout().execute(LeaveAlternateScreen)?;
+ io::stdout().execute(DisableMouseCapture)?;
disable_raw_mode()?;
Ok(())
}