Last active
July 17, 2020 20:57
-
-
Save szmeku/5b8b8f37758ca4e1fae20c898ddf6502 to your computer and use it in GitHub Desktop.
fixFBBug.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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