Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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