Fix xterm mouse parser

Only two bits represents button state, not three.

Signed-off-by: Robert Vojta <rvojta@me.com>
This commit is contained in:
Robert Vojta 2019-11-22 12:37:34 +01:00 committed by Robert Vojta
parent 9a34b1c1d2
commit a8928d1fda

View File

@ -498,7 +498,7 @@ pub(crate) fn parse_csi_xterm_mouse(buffer: &[u8]) -> Result<Option<InternalEven
let drag = cb & 0b0010_0000 == 0b0010_0000; let drag = cb & 0b0010_0000 == 0b0010_0000;
match (cb & 0b111, up, drag) { match (cb & 0b0000_0011, up, drag) {
(0, true, _) => MouseEvent::Up(MouseButton::Left, cx, cy, modifiers), (0, true, _) => MouseEvent::Up(MouseButton::Left, cx, cy, modifiers),
(0, false, false) => MouseEvent::Down(MouseButton::Left, cx, cy, modifiers), (0, false, false) => MouseEvent::Down(MouseButton::Left, cx, cy, modifiers),
(0, false, true) => MouseEvent::Drag(MouseButton::Left, cx, cy, modifiers), (0, false, true) => MouseEvent::Drag(MouseButton::Left, cx, cy, modifiers),