Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created September 1, 2022 18:31
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 tmcw/8a15d805ba55af6209cd3ed22573199a to your computer and use it in GitHub Desktop.
Save tmcw/8a15d805ba55af6209cd3ed22573199a to your computer and use it in GitHub Desktop.
export function useMapKeybindings() {
const rep = usePersistence();
const historyControl = rep.useHistoryControl();
const transact = rep.useTransact();
useHotkeys(
"Command+z, Ctrl+z",
(e) => {
e.preventDefault();
historyControl("undo");
return false;
},
[historyControl]
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment