From fb0c2f24433395928771400b894f13ca375ffc8e Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Mon, 21 Nov 2022 23:19:56 -0300 Subject: [PATCH] add shortcuts to undo/redo Signed-off-by: Victor Seiji Hariki --- index.html | 1 + js/shortcuts.js | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 js/shortcuts.js diff --git a/index.html b/index.html index 42f70b7..19e484a 100644 --- a/index.html +++ b/index.html @@ -190,6 +190,7 @@ + \ No newline at end of file diff --git a/js/shortcuts.js b/js/shortcuts.js new file mode 100644 index 0000000..5397d55 --- /dev/null +++ b/js/shortcuts.js @@ -0,0 +1,8 @@ +// Listen for shortcuts +keyboard.onShortcut({ctrl: true, key: "KeyZ"}, () => { + commands.undo(); +}); + +keyboard.onShortcut({ctrl: true, key: "KeyY"}, () => { + commands.redo(); +});