Created
April 20, 2018 07:24
-
-
Save mrkacan/168dfe39744434f039048a011f0a12d1 to your computer and use it in GitHub Desktop.
Javascript escape shortcuts listener
This file contains 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.addEventListener('keydown', (keyboardEvent) => { | |
if ((keyboardEvent.key === "Escape" || keyboardEvent.key === "Esc")) { | |
//Do something... | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment