From 7a24b38854fa4fac6c63cbe4484987c028694c3a Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Sun, 3 Nov 2024 23:02:02 +0200 Subject: [PATCH] Reorder conditions in `all_conditions` example --- examples/all_conditions.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/all_conditions.rs b/examples/all_conditions.rs index 0b6216d..c5754bf 100644 --- a/examples/all_conditions.rs +++ b/examples/all_conditions.rs @@ -43,15 +43,15 @@ impl InputContext for DummyContext { ctx.bind::() .with(PressAction::KEY) .with_condition(Press::default()); + ctx.bind::() + .with(JustPressAction::KEY) + .with_condition(JustPress::new(1.0)); ctx.bind::() .with(HoldAction::KEY) .with_condition(Hold::new(1.0)); ctx.bind::() .with(HoldAndReleaseAction::KEY) .with_condition(HoldAndRelease::new(1.0)); - ctx.bind::() - .with(JustPressAction::KEY) - .with_condition(JustPress::new(1.0)); ctx.bind::() .with(PulseAction::KEY) .with_condition(Pulse::new(1.0)); @@ -89,25 +89,25 @@ impl PressAction { #[derive(Debug, InputAction)] #[input_action(dim = Bool)] -struct HoldAction; +struct JustPressAction; -impl HoldAction { +impl JustPressAction { const KEY: KeyCode = KeyCode::Digit2; } #[derive(Debug, InputAction)] #[input_action(dim = Bool)] -struct HoldAndReleaseAction; +struct HoldAction; -impl HoldAndReleaseAction { +impl HoldAction { const KEY: KeyCode = KeyCode::Digit3; } #[derive(Debug, InputAction)] #[input_action(dim = Bool)] -struct JustPressAction; +struct HoldAndReleaseAction; -impl JustPressAction { +impl HoldAndReleaseAction { const KEY: KeyCode = KeyCode::Digit4; }