diff --git a/README.adoc b/README.adoc index c4154ac..9755379 100644 --- a/README.adoc +++ b/README.adoc @@ -50,8 +50,6 @@ The color configuration is optional. If used, all colors must be specified. === Execute commands -_This feature is still experimental._ - You can also specify a command to be executed when a mouse click occurs on a checked host. Use `click_cmd` to specifiy the command to be executed, e.g. diff --git a/src/main.rs b/src/main.rs index d22c24b..acee653 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,6 +41,7 @@ struct ActuatorResponse { #[derive(Deserialize)] struct ClickEvent { name: String, + button: u8, } struct CheckResult { @@ -184,6 +185,10 @@ async fn main() { let input = input.replace(",{", "{"); if let Ok(click_event) = serde_json::from_str::(input.as_str()) { + // Ignore click event if not left mouse button + if click_event.button != 1 { + continue; + }; if let Some(click_cmd) = get_click_cmd(click_event.name).await { run_click_cmd(click_cmd).await; }