diff options
author | Celti Burroughs <celti@celti.name> | 2018-01-26 14:28:43 -0700 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-03-12 23:21:19 -0700 |
commit | fb43c73a38e7941f4208e17f3428c21006f29299 (patch) | |
tree | 43921a2e8ec25602b33f2d08cffba516c7981016 /src/event.rs | |
parent | 5dad4919a227a265880de3abaa9940b4220a2d95 (diff) | |
download | alacritty-fb43c73a38e7941f4208e17f3428c21006f29299.tar.gz alacritty-fb43c73a38e7941f4208e17f3428c21006f29299.zip |
Extend SGR and VT200 (normal) mouse support
With this commit, Alacritty now reports presses and releases of all
three mouse buttons properly, dragging events with all three buttons,
and mouse movement events where no button is pressed.
It does not report more than three buttons due to inherent limitations
of the VT200 and SGR protocol modes. It does not report modifier keys on
mouse buttons due to practical considerations.
Fixes #714, #506.
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/event.rs b/src/event.rs index 8c4107ca..770ac53e 100644 --- a/src/event.rs +++ b/src/event.rs @@ -148,6 +148,8 @@ pub struct Mouse { pub x: u32, pub y: u32, pub left_button_state: ElementState, + pub middle_button_state: ElementState, + pub right_button_state: ElementState, pub last_click_timestamp: Instant, pub click_state: ClickState, pub scroll_px: i32, @@ -164,6 +166,8 @@ impl Default for Mouse { y: 0, last_click_timestamp: Instant::now(), left_button_state: ElementState::Released, + middle_button_state: ElementState::Released, + right_button_state: ElementState::Released, click_state: ClickState::None, scroll_px: 0, line: Line(0), |