From 7093f142916d1e6887432dfd88697a1c2ed1b004 Mon Sep 17 00:00:00 2001 From: Enrico Zandomeni Borba Date: Sun, 4 Aug 2024 09:16:15 +0200 Subject: add scroll coordinates adds scroll amount in the upper 16-bits of `Key.modifiers`, reclaiming the space in `Key.key` for coordinates. Previously, while mouse events included their coordinates, scrolling did not. Scroll events are now emitted as . --- src/keys.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/keys.cc') diff --git a/src/keys.cc b/src/keys.cc index 5ba44181..ad66658a 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -7,6 +7,7 @@ #include "utf8_iterator.hh" #include "utils.hh" #include "string_utils.hh" +#include "terminal_ui.hh" namespace Kakoune { @@ -196,7 +197,7 @@ String to_string(Key key) else if (key.modifiers & Key::Modifiers::MouseRelease) res = format("mouse:release:{}:{}.{}", key.mouse_button(), coord.line, coord.column); else if (key.modifiers & Key::Modifiers::Scroll) - res = format("scroll:{}", static_cast(key.key)); + res = format("scroll:{}:{}.{}", key.scroll_amount(), coord.line, coord.column); else if (key.modifiers & Key::Modifiers::Resize) res = format("resize:{}.{}", coord.line, coord.column); else -- cgit v1.2.3