aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/assets/prost/api.key.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-05-27 16:15:09 +0200
committerGitHub <noreply@github.com>2024-05-27 16:15:09 +0200
commit62c37a87cca5aaa8b0e580b973b93513ed616dba (patch)
tree5836dba1572dd4e95cc6e312f82b1ad4f263957e /zellij-utils/assets/prost/api.key.rs
parentdocs(changelog): ooo plugin events fix (diff)
downloadsl0ppij-62c37a87cca5aaa8b0e580b973b93513ed616dba.tar.gz
sl0ppij-62c37a87cca5aaa8b0e580b973b93513ed616dba.tar.xz
sl0ppij-62c37a87cca5aaa8b0e580b973b93513ed616dba.zip
feat(keybindings): support multiple modifiers (eg. Ctrl+Alt) and the kitty keyboard protocol (#3383)
* parse kitty keys from STDIN * work * work * replace internal Key representation with the new KeyWithModifier in all the places * work * work * allow disabling with config * adjust ordering * handle enabling/disabling properly on the client * support multiple modifiers without kitty too * normalize uppercase keys * get tests to pass * various cleanups * style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/assets/prost/api.key.rs')
-rw-r--r--zellij-utils/assets/prost/api.key.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/zellij-utils/assets/prost/api.key.rs b/zellij-utils/assets/prost/api.key.rs
index 186f41c1..92c47492 100644
--- a/zellij-utils/assets/prost/api.key.rs
+++ b/zellij-utils/assets/prost/api.key.rs
@@ -3,6 +3,8 @@
pub struct Key {
#[prost(enumeration = "key::KeyModifier", optional, tag = "1")]
pub modifier: ::core::option::Option<i32>,
+ #[prost(enumeration = "key::KeyModifier", repeated, tag = "4")]
+ pub additional_modifiers: ::prost::alloc::vec::Vec<i32>,
#[prost(oneof = "key::MainKey", tags = "2, 3")]
pub main_key: ::core::option::Option<key::MainKey>,
}
@@ -23,6 +25,8 @@ pub mod key {
pub enum KeyModifier {
Ctrl = 0,
Alt = 1,
+ Shift = 2,
+ Super = 3,
}
impl KeyModifier {
/// String value of the enum field names used in the ProtoBuf definition.
@@ -33,6 +37,8 @@ pub mod key {
match self {
KeyModifier::Ctrl => "CTRL",
KeyModifier::Alt => "ALT",
+ KeyModifier::Shift => "SHIFT",
+ KeyModifier::Super => "SUPER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -40,6 +46,8 @@ pub mod key {
match value {
"CTRL" => Some(Self::Ctrl),
"ALT" => Some(Self::Alt),
+ "SHIFT" => Some(Self::Shift),
+ "SUPER" => Some(Self::Super),
_ => None,
}
}
@@ -82,6 +90,13 @@ pub mod key {
F12 = 22,
Tab = 23,
Esc = 24,
+ CapsLock = 25,
+ ScrollLock = 26,
+ NumLock = 27,
+ PrintScreen = 28,
+ Pause = 29,
+ Menu = 30,
+ Enter = 31,
}
impl NamedKey {
/// String value of the enum field names used in the ProtoBuf definition.
@@ -115,6 +130,13 @@ pub mod key {
NamedKey::F12 => "F12",
NamedKey::Tab => "Tab",
NamedKey::Esc => "Esc",
+ NamedKey::CapsLock => "CapsLock",
+ NamedKey::ScrollLock => "ScrollLock",
+ NamedKey::NumLock => "NumLock",
+ NamedKey::PrintScreen => "PrintScreen",
+ NamedKey::Pause => "Pause",
+ NamedKey::Menu => "Menu",
+ NamedKey::Enter => "Enter",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -145,6 +167,13 @@ pub mod key {
"F12" => Some(Self::F12),
"Tab" => Some(Self::Tab),
"Esc" => Some(Self::Esc),
+ "CapsLock" => Some(Self::CapsLock),
+ "ScrollLock" => Some(Self::ScrollLock),
+ "NumLock" => Some(Self::NumLock),
+ "PrintScreen" => Some(Self::PrintScreen),
+ "Pause" => Some(Self::Pause),
+ "Menu" => Some(Self::Menu),
+ "Enter" => Some(Self::Enter),
_ => None,
}
}