Created
November 8, 2019 06:36
-
-
Save drifterz28/5bde745a814a2cb2b72ec851759bbbd7 to your computer and use it in GitHub Desktop.
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
const P_KEY_CODE = 80; | |
const handleKeyPress = e => { | |
if (e.shiftKey && e.keyCode === P_KEY_CODE) { | |
togglePrefs(!showConsolePrefs); | |
} | |
}; | |
window.addEventListener('keydown', handleKeyPress); | |
return () => { | |
window.removeEventListener('keydown', handleKeyPress); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment