Keyboard Shortcuts - cdaein/ssam GitHub Wiki
Keyboard Shortcuts
Shortcut | Description |
---|---|
CMD(or Ctrl) + S |
Export an image. (PNG by default) |
CMD(or Ctrl) + Shift + S |
Export a video (WebM by default). |
CMD(or Ctrl) + K |
Git commit and export an image snapshot with the commit hash. |
CMD(or Ctrl) + Shift + K |
Git commit and export an mp4 with the commit hash. |
Spacebar |
Pause or resume animation |
You can disable keyboard shortcuts (hotkeys) by setting your settings
object:
ssam(sketch, {
// disable all hotkeys
hotkeys: false,
// disable individual hotkeys
hotkeys: {
togglePlay: false,
exportFrame: false,
exportFrames: false,
git: false,
}
})
If you want to export an image or video in other ways, use the function prop, either props.exportFrame()
or props.exportFrames()
. For example, you can set the settings.hotkeys
to false
and add an event listener to a different keyboard shortcut.
✋ Note that
props.exportFrames()
should only be called once to start video recording. Don't call it every frame. If you call it again while recording, it will finish the current recording early.