svghmi/widget_keypad.ysl2
branchsvghmi
changeset 2919 c6e6051898f5
parent 2917 c8d923dd707f
child 2920 3ee337c8c769
equal deleted inserted replaced
2918:5cb6ab87b185 2919:c6e6051898f5
    13     |             this.«.»_elt.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_«.»_click()");
    13     |             this.«.»_elt.setAttribute("onclick", "hmi_widgets['«$hmi_element/@id»'].on_«.»_click()");
    14     }
    14     }
    15     |     },
    15     |     },
    16     |     on_key_click: function(symbols) {
    16     |     on_key_click: function(symbols) {
    17     |         var syms = symbols.split(" ");
    17     |         var syms = symbols.split(" ");
    18     |         this.shift = this.caps;
    18     |         this.shift |= this.caps;
    19     |         this.editstr += syms[this.shift?syms.length:0];
    19     |         this.editstr += syms[this.shift?syms.length-1:0];
    20     |         this.shift = false;
    20     |         this.shift = false;
    21     |         this.update();
    21     |         this.update();
    22     |         console.log(symbols);
    22     |         console.log(symbols);
    23     |     },
    23     |     },
    24     |     on_Esc_click: function() {
    24     |     on_Esc_click: function() {
    43     |             this.editstr = "-" + this.editstr;
    43     |             this.editstr = "-" + this.editstr;
    44     |         console.log("Sign");
    44     |         console.log("Sign");
    45     |     },
    45     |     },
    46     |     on_Space_click: function() {
    46     |     on_Space_click: function() {
    47     |         this.editstr += " ";
    47     |         this.editstr += " ";
       
    48     |         this.update();
    48     |         console.log("Space");
    49     |         console.log("Space");
    49     |     },
    50     |     },
    50     |     caps: false,
    51     |     caps: false,
    51     |     on_CapsLock_click: function() {
    52     |     on_CapsLock_click: function() {
    52     |         this.caps = !this.caps;
    53     |         this.caps = !this.caps;
       
    54     |         this.update();
    53     |         console.log("CapsLock");
    55     |         console.log("CapsLock");
    54     |     },
    56     |     },
    55     |     shift: false,
    57     |     shift: false,
    56     |     on_Shift_click: function() {
    58     |     on_Shift_click: function() {
    57     |         this.shift = true;
    59     |         this.shift = true;
       
    60     |         this.caps = false;
       
    61     |         this.update();
    58     |         console.log("Shift");
    62     |         console.log("Shift");
    59     |     },
    63     |     },
    60     const "g", "$geometry[@Id = $hmi_element/@id]"; 
    64     const "g", "$geometry[@Id = $hmi_element/@id]"; 
    61     |     coordinates: [«$g/@x», «$g/@y»],
    65     |     coordinates: [«$g/@x», «$g/@y»],
    62     |     editstr: "",
    66     |     editstr: "",