diff --git a/src/keys.cc b/src/keys.cc index ad66658a4..e08a67092 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -7,7 +7,6 @@ #include "utf8_iterator.hh" #include "utils.hh" #include "string_utils.hh" -#include "terminal_ui.hh" namespace Kakoune { diff --git a/src/keys.hh b/src/keys.hh index b4796ea5f..3c5d7f4b3 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -89,9 +89,9 @@ struct Key constexpr bool operator==(Key other) const { return val() == other.val(); } constexpr auto operator<=>(Key other) const { return val() <=> other.val(); } - constexpr DisplayCoord coord() const { return {(int)((key & 0xFFFF0000) >> 16), (int)(key & 0x0000FFFF)}; } + constexpr DisplayCoord coord() const { return {(int)((int32_t) (key & 0xFFFF0000) >> 16), (int)(key & 0x0000FFFF)}; } constexpr MouseButton mouse_button() { return MouseButton{((int)modifiers & (int)Modifiers::MouseButtonMask) >> 6}; } - constexpr int scroll_amount() { return (int)modifiers >> 16; } + constexpr int scroll_amount() { return (int32_t)modifiers >> 16; } static Modifiers to_modifier(MouseButton button) { return Key::Modifiers{((int)button << 6) & (int)Modifiers::MouseButtonMask}; } Optional codepoint() const;