Skip to content

Instantly share code, notes, and snippets.

@szmeku
Last active July 17, 2020 20:57
Show Gist options
  • Select an option

  • Save szmeku/5b8b8f37758ca4e1fae20c898ddf6502 to your computer and use it in GitHub Desktop.

Select an option

Save szmeku/5b8b8f37758ca4e1fae20c898ddf6502 to your computer and use it in GitHub Desktop.
fixFBBug.js
window.keys = {};
document.activeElement.addEventListener("keydown",
function(e){
keys[e.keyCode] = true;
console.log(JSON.stringify(keys));
if(keys[32] && keys[18]){
console.log('fafa');
e.preventDefault()
e.stopPropagation()
}
},
false);
document.activeElement.addEventListener('keyup',
function(e){
keys[e.keyCode] = false;
console.log(JSON.stringify(keys));
if(keys[32] && keys[18]){
console.log('fafa');
e.preventDefault()
e.stopPropagation()
}
},
false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment