Reorganize scripts for better clarity

This commit is contained in:
Edward Firmo
2024-12-21 21:18:54 +01:00
parent 5c4581563e
commit 35cc0c4a8e

View File

@@ -114,6 +114,19 @@ script:
id(button_press_start_time) = 0; id(button_press_start_time) = 0;
buttons_release->execute(); buttons_release->execute();
- id: button_click_event
mode: restart
then:
- delay:
milliseconds: ${BUTTON_MULTI_CLICK_DELAY}
- lambda: |-
button_action->execute(
("bs_button_" + std::to_string(id(button_press_button))).c_str(),
(id(click_counter) == 1 ? "click" :
(id(click_counter) == 2 ? "double_click" :
(std::to_string(id(click_counter)) + "_click").c_str()))
);
- id: buttons_release - id: buttons_release
mode: restart mode: restart
then: then:
@@ -206,19 +219,6 @@ script:
} }
id(button_press_start_time) = 0; id(button_press_start_time) = 0;
- id: button_click_event
mode: restart
then:
- delay:
milliseconds: ${BUTTON_MULTI_CLICK_DELAY}
- lambda: |-
button_action->execute(
("bs_button_" + std::to_string(id(button_press_button))).c_str(),
(id(click_counter) == 1 ? "click" :
(id(click_counter) == 2 ? "double_click" :
(std::to_string(id(click_counter)) + "_click").c_str()))
);
- id: !extend touch_swipe_left - id: !extend touch_swipe_left
then: then:
- script.execute: buttons_release - script.execute: buttons_release