From abd5afe0129abad0fec6799fc7329a0ca38c1e45 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 23 Mar 2016 13:39:52 +0000 Subject: [PATCH] Support mosue event in key_to_str --- src/keys.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/keys.cc b/src/keys.cc index f98a5dc0a..7eb55e46b 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -114,7 +114,23 @@ KeyList parse_keys(StringView str) String key_to_str(Key key) { if (key.modifiers & Key::Modifiers::MouseEvent) - return ""; + { + const auto coord = key.coord() + CharCoord{1,1}; + switch (key.modifiers) + { + case Key::Modifiers::MousePos: + return format("", coord.line, coord.column); + case Key::Modifiers::MousePress: + return format("", coord.line, coord.column); + case Key::Modifiers::MouseRelease: + return format("", coord.line, coord.column); + case Key::Modifiers::MouseWheelDown: + return ""; + case Key::Modifiers::MouseWheelUp: + return ""; + default: kak_assert(false); + } + } bool named = false; String res;