From a9627cd552bd8cf22fa33785edc640490ad66ce1 Mon Sep 17 00:00:00 2001 From: houmain Date: Sat, 7 Sep 2024 08:26:12 +0200 Subject: [PATCH] Added logical key Alt --- src/config/ParseConfig.cpp | 1 + src/config/get_key_name.cpp | 3 +++ src/runtime/Key.h | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config/ParseConfig.cpp b/src/config/ParseConfig.cpp index de287e5b..0a082506 100644 --- a/src/config/ParseConfig.cpp +++ b/src/config/ParseConfig.cpp @@ -193,6 +193,7 @@ Config ParseConfig::operator()(std::istream& is, // register common logical keys add_logical_key("Shift", Key::ShiftLeft, Key::ShiftRight); add_logical_key("Control", Key::ControlLeft, Key::ControlRight); + add_logical_key("Alt", Key::AltLeft, Key::AltRight); add_logical_key("Meta", Key::MetaLeft, Key::MetaRight); parse_file(is); diff --git a/src/config/get_key_name.cpp b/src/config/get_key_name.cpp index ba2e9d33..51f8b9ee 100644 --- a/src/config/get_key_name.cpp +++ b/src/config/get_key_name.cpp @@ -218,6 +218,7 @@ const char* get_key_name(const Key& key) { case Key::first_action: case Key::last_action: case Key::Control: + case Key::Alt: case Key::Meta: break; } @@ -287,6 +288,8 @@ Key get_key_by_name(std::string_view name) { return Key::Shift; if (name == "Control") return Key::Control; + if (name == "Alt") + return Key::Alt; if (name == "Meta") return Key::Meta; diff --git a/src/runtime/Key.h b/src/runtime/Key.h index 61625d7a..fa9cadbf 100644 --- a/src/runtime/Key.h +++ b/src/runtime/Key.h @@ -479,7 +479,8 @@ enum class Key : uint16_t { Shift = first_logical, Control = first_logical + 1, - Meta = first_logical + 2, + Alt = first_logical + 2, + Meta = first_logical + 3, }; constexpr uint16_t operator*(Key key) { return static_cast(key); }