# HG changeset patch # User Edouard Tisserant # Date 1586015236 -7200 # Node ID c6e6051898f587b66a5246414584d11248c0fabb # Parent 5cb6ab87b1854e03f39c589e625044af30c41da1 SVGHMI: fixed keypad JS regarding shift/capslock and other details diff -r 5cb6ab87b185 -r c6e6051898f5 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Sat Apr 04 09:41:32 2020 +0200 +++ b/svghmi/gen_index_xhtml.xslt Sat Apr 04 17:47:16 2020 +0200 @@ -1233,9 +1233,9 @@ var syms = symbols.split(" "); - this.shift = this.caps; - - this.editstr += syms[this.shift?syms.length:0]; + this.shift |= this.caps; + + this.editstr += syms[this.shift?syms.length-1:0]; this.shift = false; @@ -1482,7 +1482,6 @@ Made with SVGHMI. https://beremiz.org - diff -r 5cb6ab87b185 -r c6e6051898f5 svghmi/widget_keypad.ysl2 --- a/svghmi/widget_keypad.ysl2 Sat Apr 04 09:41:32 2020 +0200 +++ b/svghmi/widget_keypad.ysl2 Sat Apr 04 17:47:16 2020 +0200 @@ -15,8 +15,8 @@ | }, | on_key_click: function(symbols) { | var syms = symbols.split(" "); - | this.shift = this.caps; - | this.editstr += syms[this.shift?syms.length:0]; + | this.shift |= this.caps; + | this.editstr += syms[this.shift?syms.length-1:0]; | this.shift = false; | this.update(); | console.log(symbols); @@ -45,16 +45,20 @@ | }, | on_Space_click: function() { | this.editstr += " "; + | this.update(); | console.log("Space"); | }, | caps: false, | on_CapsLock_click: function() { | this.caps = !this.caps; + | this.update(); | console.log("CapsLock"); | }, | shift: false, | on_Shift_click: function() { | this.shift = true; + | this.caps = false; + | this.update(); | console.log("Shift"); | }, const "g", "$geometry[@Id = $hmi_element/@id]";