Skip to content

Instantly share code, notes, and snippets.

View oodzchen's full-sized avatar
🎯
Focusing

Kholin oodzchen

🎯
Focusing
View GitHub Profile
@oodzchen
oodzchen / multiple-keypress.js
Created March 2, 2017 16:37
check multiple keys pressed at same time
window.keysOnHold = [];
window.onkeydown = function(e){
if(this.keysOnHold.indexOf(e.keyCode) < 0){
this.keysOnHold.push(e.keyCode);
}
console.log(this.keysOnHold);
};
window.onkeyup = function(e){