Created
October 13, 2020 19:47
-
-
Save ljmotta/c066c5b68a332526c09490fe33cb557c to your computer and use it in GitHub Desktop.
Base64Png Editor KeyboardShortcuts
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
useEffect(() => { | |
const invertId = props.envelopeContext.services.keyboardShortcuts.registerKeyPress( | |
"i", | |
`Edit | Invert Image`, | |
async () => { | |
if (!disabled && invert === "100") { | |
tweakInvert("0"); | |
} else if (!disabled && invert === "0") { | |
tweakInvert("100"); | |
} | |
} | |
); | |
return () => { | |
props.envelopeContext.services.keyboardShortcuts.deregister(invertId); | |
}; | |
}, [disabled, invert]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment