svghmi/widget_button.ysl2
author Edouard Tisserant
Mon, 11 May 2020 11:10:38 +0200
branchsvghmi
changeset 2956 6b01738308bb
parent 2944 2a20038fbea9
child 2961 00825316ed00
permissions -rw-r--r--
DEBUG: (IDE side) fixed wrong implementation of anti-rapid-fire leading to systematic delay in subscribing
// widget_button.ysl2

template "widget[@type='Button']", mode="widget_defs" {
    param "hmi_element";
    | frequency: 5,
    | init: function() {
    |     this.element.addEventListener(
    |       "mousedown",
    |       evt => {
    |           change_hmi_value(this.indexes[0], "=1");
    |       });
    |     this.element.addEventListener(
    |       "mouseup",
    |       evt => {
    |           change_hmi_value(this.indexes[0], "=0");
    |       });
    | },
}