瀏覽代碼

更新 'games/yqrxd/launcher/egret_loader.js'

yunhaipiaodi 6 年之前
父節點
當前提交
70f43387c2
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      games/yqrxd/launcher/egret_loader.js

+ 14 - 0
games/yqrxd/launcher/egret_loader.js

@@ -37,6 +37,20 @@ egret_h5.startGame = function () {
     else{
         throw new Error("找不到文档类!");
     }
+	
+  	 //添加左右键盘按键操作
+    document.onkeydown = function (event) {
+        var e = event || window.event || arguments.callee.caller.arguments[0];
 
 
+        if(e && e.keyCode == 39){       //右方向键
+            rootClass.ingame.clickBtnNum = 1;
+        }
+
+        if(e && e.keyCode == 37){       //左方向键
+            rootClass.ingame.clickBtnNum = 0;
+        }
+        rootClass.ingame.checkValue();
+    };
+
 };