Skip to content

Commit

Permalink
Added logical key Alt
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Sep 7, 2024
1 parent 70f075d commit a9627cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config/ParseConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/config/get_key_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion src/runtime/Key.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint16_t>(key); }
Expand Down

0 comments on commit a9627cd

Please sign in to comment.