Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Created October 13, 2020 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/c066c5b68a332526c09490fe33cb557c to your computer and use it in GitHub Desktop.
Save ljmotta/c066c5b68a332526c09490fe33cb557c to your computer and use it in GitHub Desktop.
Base64Png Editor KeyboardShortcuts
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