diff --git a/examples/worf-warden/src/main.rs b/examples/worf-warden/src/main.rs index 6f05733..1300e09 100644 --- a/examples/worf-warden/src/main.rs +++ b/examples/worf-warden/src/main.rs @@ -178,7 +178,7 @@ fn key_type_all() -> KeyBinding { fn key_type_all_and_enter() -> KeyBinding { KeyBinding { - key: Key::Exclamation, + key: Key::Num1, modifiers: vec![Modifier::Alt, Modifier::Shift].into_iter().collect(), label: String::new(), visible: false, @@ -196,7 +196,7 @@ fn key_type_user() -> KeyBinding { fn key_type_user_and_enter() -> KeyBinding { KeyBinding { - key: Key::At, + key: Key::Num2, modifiers: vec![Modifier::Alt, Modifier::Shift].into_iter().collect(), label: String::new(), visible: false, @@ -214,7 +214,7 @@ fn key_type_password() -> KeyBinding { fn key_type_password_and_enter() -> KeyBinding { KeyBinding { - key: Key::Hash, + key: Key::Num3, modifiers: vec![Modifier::Alt, Modifier::Shift].into_iter().collect(), label: String::new(), visible: false, @@ -232,7 +232,7 @@ fn key_type_totp() -> KeyBinding { fn key_type_totp_and_enter() -> KeyBinding { KeyBinding { - key: Key::Dollar, + key: Key::Num4, modifiers: vec![Modifier::Alt, Modifier::Shift].into_iter().collect(), label: String::new(), visible: false, diff --git a/worf/src/lib/config.rs b/worf/src/lib/config.rs index d0896ad..bba6451 100644 --- a/worf/src/lib/config.rs +++ b/worf/src/lib/config.rs @@ -369,7 +369,7 @@ pub struct Config { #[clap(long = "emoji-hide-string")] emoji_hide_label: Option, - #[clap(long = "keyboard-detection-type")] + #[clap(long = "key-detection-type")] key_detection_type: Option, } @@ -832,3 +832,22 @@ pub fn fork_if_configured(config: &Config) { std::process::exit(0); } } + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_keyboard_type() { + let toml_str = r#" + key_detection_type="Code" + "#; + + let config: Config = toml::from_str(toml_str).expect("Failed to parse TOML"); + assert_eq!(config.key_detection_type(), KeyDetectionType::Code); + } + + + +}