Last active
August 11, 2022 03:06
-
-
Save lewdev/b76e41a5f8a122b99bff6809e4e75ceb to your computer and use it in GitHub Desktop.
⌨ Track multiple key presses at once
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
| data:text/html,<body style=font:12vw' onkeyup='this.innerHTML=["key","keyCode","code"].map(k=>`${k}: ${event[k]}`).join`<br>`'>Press a key |
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
| data:text/html,<body id=o onload="k={};onkeypress=onkeyup=onkeydown=e=>{e.preventDefault();k[e.key]=!!e.type[5];o.innerHTML=Object.keys(k).filter(p=>k[p]).join`, `}"style=font:12vw'>Press Multiple |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment