aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorChristian Dürr <contact@christianduerr.com>2017-12-28 21:36:30 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2018-01-03 11:15:57 -0800
commitb83a26ffe097ba9bf80b2801ba27737f6ccd90be (patch)
tree6c19f20fcb53b29f0599a55d2556b8c794a9fcad /src/event.rs
parent20aa45c8781f1954de90bb23070454a9581e6969 (diff)
downloadalacritty-b83a26ffe097ba9bf80b2801ba27737f6ccd90be.tar.gz
alacritty-b83a26ffe097ba9bf80b2801ba27737f6ccd90be.zip
Enable shift+select in mouse mode
When an application takes control over the mouse, it usually disables selection completely. However the common way to still make selection possible is by allowing selection while the shift key is held down. This feature is implemented here by making use of the new `modifiers` field on mouse events with glutin/winit. This fixes jwilm/alacritty#146.
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/event.rs b/src/event.rs
index 894777fa..3dce4d66 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -298,19 +298,19 @@ impl<N: Notify> Processor<N> {
ReceivedCharacter(c) => {
processor.received_char(c);
},
- MouseInput { state, button, .. } => {
+ MouseInput { state, button, modifiers, .. } => {
*hide_cursor = false;
- processor.mouse_input(state, button);
+ processor.mouse_input(state, button, modifiers);
processor.ctx.terminal.dirty = true;
},
- CursorMoved { position: (x, y), .. } => {
+ CursorMoved { position: (x, y), modifiers, .. } => {
let x = x as i32;
let y = y as i32;
let x = limit(x, 0, processor.ctx.size_info.width as i32);
let y = limit(y, 0, processor.ctx.size_info.height as i32);
*hide_cursor = false;
- processor.mouse_moved(x as u32, y as u32);
+ processor.mouse_moved(x as u32, y as u32, modifiers);
if !processor.ctx.selection.is_none() {
processor.ctx.terminal.dirty = true;