diff --git a/touch/index.html b/touch/index.html index 74c263b..b3c488e 100644 --- a/touch/index.html +++ b/touch/index.html @@ -58,15 +58,38 @@ } return num; } - document.onkeydown = function () { - if (!kb_isstart) return; + // document.onkeydown = function () { + // if (!kb_isstart) return; + // var code = event.keyCode; + // //[st]sduf87fjsdfysd78,526976123; + // if (code == 16) return; + // kb_dealKey(fromKeyCode(code)); + // } + + var num = 0; + var pre_value = ""; + document.onkeydown = function() { + if(!kb_isstart) return ; var code = event.keyCode; //[st]sduf87fjsdfysd78,526976123; - if (code == 16) return; + if(code == 16) return ; + if(code != 186 && num == 0){ + kb_dealKey(fromKeyCode(186)); // ; + } + if(code == 13 && num != 0){ + if(pre_value != 191){ + kb_dealKey(fromKeyCode(191)); // ? + } + num = 0; + } kb_dealKey(fromKeyCode(code)); + if(code != 13){ + // 最后一次不在叠加 + num++; + } + pre_value = code; } - function kb_dealKey(c) { if (kb_status == '1') { //开始