사용자:Bd3076/common.js: 두 판 사이의 차이
백괴게임>Bd3076 편집 요약 없음 |
백괴게임>Bd3076 편집 요약 없음 |
||
1번째 줄: | 1번째 줄: | ||
var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydown",onKeyDown,false);var onKeyUp = function(e){ var ek = e.keyCode; keyDown[ek] = 0;};window.addEventListener("keyup",onKeyUp,false);var makeEdit = function(){ console.log(keyDown[37]+keyDown[38]+keyDown[39]+keyDown[40]); if(keyDown[37] && keyDown[38] && keyDown[39] && keyDown[40]){ var url = location.href; if(url.indexOf('?') == -1) location.href=url+'?action=edit'; else location.href=url+'&action=edit'; }};setInterval(makeEdit, 1000); | var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydown",onKeyDown,false);var onKeyUp = function(e){ var ek = e.keyCode; keyDown[ek] = 0;};window.addEventListener("keyup",onKeyUp,false);var makeEdit = function(){ console.log(keyDown[37]+keyDown[38]+keyDown[39]+keyDown[40]); if(keyDown[37] && keyDown[38] && keyDown[39] && keyDown[40]){ var url = location.href; if(url.indexOf('?') == -1) location.href=url+'?action=edit'; else location.href=url+'&action=edit'; }};setInterval(makeEdit, 1000); | ||
2019년 2월 21일 (목) 14:45 판
var keyDown = new Array(128);for(var i=0; i<128; i++){ keyDown[i] = 0;}var onKeyDown = function(e){ var ek = e.keyCode; keyDown[ek] = 1;};window.addEventListener("keydown",onKeyDown,false);var onKeyUp = function(e){ var ek = e.keyCode; keyDown[ek] = 0;};window.addEventListener("keyup",onKeyUp,false);var makeEdit = function(){ console.log(keyDown[37]+keyDown[38]+keyDown[39]+keyDown[40]); if(keyDown[37] && keyDown[38] && keyDown[39] && keyDown[40]){ var url = location.href; if(url.indexOf('?') == -1) location.href=url+'?action=edit'; else location.href=url+'&action=edit'; }};setInterval(makeEdit, 1000);