MCPcopy Create free account
hub / github.com/Raais/ImStudio / EM_JS

Function EM_JS

src/utils/JsClipboardTricks.cpp:41–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#ifdef IMGUIMANUAL_CLIPBOARD_IMPORT_FROM_BROWSER
40
41 EM_JS(void, sapp_add_js_hook_clipboard, (void), {
42 // See also https://whatwebcando.today/clipboard.html
43 // for the new async api with user permissions dialog
44 Module.sokol_paste = function(event) {
45 // console.log("Got paste event ");
46 var pasted_str = event.clipboardData.getData('text');
47 ccall('_sapp_emsc_onpaste', 'void', ['string'], [pasted_str]);
48 };
49 // console.log("sapp_add_js_hook_clipboard 4");
50 window.addEventListener('paste', Module.sokol_paste);
51 });

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected