Commit 33ffce0d authored by Wen Wei Li's avatar Wen Wei Li

disable shift button

parent f4ad973c
...@@ -10,7 +10,7 @@ let myKeyboard = new Keyboard({ ...@@ -10,7 +10,7 @@ let myKeyboard = new Keyboard({
"1 2 3", "1 2 3",
"4 5 6", "4 5 6",
"7 8 9", "7 8 9",
"{shift} 0 {bksp}" " 0 {bksp}"
], ],
} }
}); });
...@@ -27,22 +27,25 @@ function onChange(input) { ...@@ -27,22 +27,25 @@ function onChange(input) {
function onKeyPress(button) { function onKeyPress(button) {
console.log("index : ", index); console.log("index : ", index);
if ( String(button) == "{bksp}" && index > 1 ){ if( String(button) != ""){
index= index - 1; if ( String(button) == "{bksp}" && index > 1 ){
n = "slot-" + index; index= index - 1;
document.querySelector('input[id="'+n+'"]').value = ''; n = "slot-" + index;
ary_input.pop(); document.querySelector('input[id="'+n+'"]').value = '';
}else if( String(button) == "{bksp}" && index == 1){ ary_input.pop();
console.log("back to the first pin code"); }else if( String(button) == "{bksp}" && index == 1){
}else if (index < 7 ){ console.log("back to the first pin code");
n = "slot-" + index; }else if (index < 7 ){
document.querySelector('input[id="'+n+'"]').value = button; n = "slot-" + index;
index = index + 1; document.querySelector('input[id="'+n+'"]').value = button;
ary_input.push(button); index = index + 1;
ary_input.push(button);
}else{
console.log("index over 6");
}
}else{ }else{
console.log("index over 6"); console.log("press space button");
} }
document.querySelector('input[id="'+n+'"]').focus(); document.querySelector('input[id="'+n+'"]').focus();
console.log("Button pressed", button); console.log("Button pressed", button);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
{% endfor %} {% endfor %}
</div> </div>
<div class="col-2 inline"> <div class="col-2 inline">
<button type="submit" class="btn btn-primary" id="conn" style="height:50px">Connect</button> <button type="submit" class="btn btn-primary" id="setup" style="height:50px">Confirm</button>
</div> </div>
</div> </div>
<div class="row align-items-center"> <div class="row align-items-center">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment