diff options
| author | Enrico Zandomeni Borba <enricozb@gmail.com> | 2024-08-04 09:16:15 +0200 |
|---|---|---|
| committer | Enrico Zandomeni Borba <enricozb@gmail.com> | 2024-08-04 17:40:29 +0200 |
| commit | 7093f142916d1e6887432dfd88697a1c2ed1b004 (patch) | |
| tree | 527df8c4b4bf1adde97a730665baad99457dde8c /src/keys.cc | |
| parent | 10ed78fe8a580b3558348746ee53f81c5b0aeae1 (diff) | |
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 <scroll:amount:line.column>.
Diffstat (limited to 'src/keys.cc')
| -rw-r--r-- | src/keys.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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<int>(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 |
