mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-22 13:01:05 +03:00
Fix bidirectional clipboard support in Emscripten builds:
SDL2 prevents the default action for Ctrl/Cmd key events on Emscripten, which stops browsers from emitting the native paste event. Intercept Ctrl/Cmd+V before SDL2 consumes it, allow the browser paste event to update the internal clipboard, and replay the keydown so the application executes its normal paste command. Also refresh the clipboard through the asynchronous Clipboard API when opening a context menu, enabling paste actions triggered without a keyboard shortcut. Export Emscripten's ccall runtime method so the browser clipboard helper can reliably invoke its C++ callbacks in optimized builds, and disable clang-format for the header containing embedded JavaScript.
This commit is contained in:
@@ -659,7 +659,7 @@ function build_link_configuration( package_name, use_ee_icon )
|
||||
add_cross_config_links()
|
||||
|
||||
configuration "emscripten"
|
||||
linkoptions { "-s TOTAL_MEMORY=536870912 -s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2 -s ENVIRONMENT=worker,web" }
|
||||
linkoptions { "-s TOTAL_MEMORY=536870912 -s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2 -s ENVIRONMENT=worker,web -s EXPORTED_RUNTIME_METHODS=ccall" }
|
||||
buildoptions { "-s USE_SDL=2" }
|
||||
buildoptions { "-s USE_PTHREADS=1" }
|
||||
linkoptions { "-s USE_PTHREADS=1 -sPTHREAD_POOL_SIZE=8" }
|
||||
|
||||
Reference in New Issue
Block a user