diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-06-23 09:57:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 12:57:15 +0300 |
commit | 43c0ad6ea9d2467ccf867a310c4f1e30f5b627c6 (patch) | |
tree | 18ca8bad91c9ca47d22fca45222566a462aaa303 /alacritty/src/event.rs | |
parent | 87e5b1aa25ea61937fa5f79668d2a46e88707c5e (diff) | |
download | r-alacritty-43c0ad6ea9d2467ccf867a310c4f1e30f5b627c6.tar.gz r-alacritty-43c0ad6ea9d2467ccf867a310c4f1e30f5b627c6.tar.bz2 r-alacritty-43c0ad6ea9d2467ccf867a310c4f1e30f5b627c6.zip |
Add selection expansion
This allows for expanding the selection using the right mouse button.
The new selection type depends on the number of clicks and applies to
both sides of the selection.
Fixes #1554.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r-- | alacritty/src/event.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 084ebe1e..630e8ef0 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -15,7 +15,7 @@ use std::sync::Arc; use std::time::Instant; use glutin::dpi::PhysicalSize; -use glutin::event::{ElementState, Event as GlutinEvent, ModifiersState, WindowEvent}; +use glutin::event::{ElementState, Event as GlutinEvent, ModifiersState, MouseButton, WindowEvent}; use glutin::event_loop::{ControlFlow, EventLoop, EventLoopProxy, EventLoopWindowTarget}; use glutin::platform::desktop::EventLoopExtDesktop; #[cfg(not(any(target_os = "macos", windows)))] @@ -351,6 +351,7 @@ pub struct Mouse { pub middle_button_state: ElementState, pub right_button_state: ElementState, pub last_click_timestamp: Instant, + pub last_click_button: MouseButton, pub click_state: ClickState, pub scroll_px: f64, pub line: Line, @@ -367,6 +368,7 @@ impl Default for Mouse { x: 0, y: 0, last_click_timestamp: Instant::now(), + last_click_button: MouseButton::Left, left_button_state: ElementState::Released, middle_button_state: ElementState::Released, right_button_state: ElementState::Released, |