From a440869573a560c6a8111a605bf5564ab7ffaf7d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 7 Sep 2019 22:33:06 +1000 Subject: [PATCH] Fix modifiers support with mouse events --- src/input_handler.cc | 3 ++- src/ncurses_ui.cc | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input_handler.cc b/src/input_handler.cc index 07211c30f..b48edce95 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -92,7 +92,8 @@ struct MouseHandler Buffer& buffer = context.buffer(); BufferCoord cursor; auto& selections = context.selections(); - switch (key.modifiers) + constexpr auto modifiers = Key::Modifiers::Control | Key::Modifiers::Alt | Key::Modifiers::Shift; + switch ((key.modifiers & ~modifiers).value) { case Key::Modifiers::MousePressRight: m_dragging = false; diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index f58962228..16db4a6a7 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -1318,8 +1318,7 @@ void NCursesUI::enable_mouse(bool enabled) fputs("\033[?1002l", stdout); fputs("\033[?1000l", stdout); fputs("\033[?1004l", stdout); - if (m_builtin_key_parser) - fputs("\033[?1006l", stdout); + fputs("\033[?1006l", stdout); } fflush(stdout); }