@mocanvas/mocanvas · function

useMenuClipboardEvents

declare function useMenuClipboardEvents(): TLUiClipboardEvents

Cut, copy and paste for the menus and the action list.

The three functions do the same work the keyboard shortcuts do; what differs is that there is no event to hang off, so paste has to ask the browser for the clipboard and may be refused. A refusal falls back to an in-page buffer, which keeps copy and paste working within one tab even where the permission was denied — which is where it matters most.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.