diff --git a/xwords4/wasm/Makefile b/xwords4/wasm/Makefile index 8b6892701..990f6af7a 100644 --- a/xwords4/wasm/Makefile +++ b/xwords4/wasm/Makefile @@ -67,7 +67,7 @@ all: main.js # ${INPUTS} -o $@ # This isn't a thing any more -main.html: ${INPUTS} $(MAKEFILE) shell_minimal.html +main.html: ${INPUTS} Makefile shell_minimal.html emcc $(DEFINES) -I . -I ../common -I ../relay -s USE_SDL=2 \ --preload-file assets_dir --shell-file shell_minimal.html \ -s USE_SDL_TTF=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' \ @@ -76,9 +76,9 @@ main.html: ${INPUTS} $(MAKEFILE) shell_minimal.html -s WASM=1 \ ${INPUTS} -o $@ -install: main.html $(MAKEFILE) +install: main.html if [ -n "${XW_WASM_DEST}" ]; then \ - for FILE in ${OUTPUTS} paho-mqtt.jspi xwutils.js; do \ + for FILE in ${OUTPUTS} paho-mqtt.js xwutils.js; do \ [ -f $$FILE ] && scp $$FILE ${XW_WASM_DEST}; \ echo "$$FILE copied"; \ done; \ diff --git a/xwords4/wasm/main.c b/xwords4/wasm/main.c index 7f6c6f357..3b19949ec 100644 --- a/xwords4/wasm/main.c +++ b/xwords4/wasm/main.c @@ -1,4 +1,4 @@ -/* -*- compile-command: "cd ../wasm && make MEMDEBUG=TRUE main.html -j3"; -*- */ +/* -*- compile-command: "cd ../wasm && make MEMDEBUG=TRUE install -j3"; -*- */ /* * Copyright 2021 by Eric House (xwords@eehouse.org). All rights reserved. * diff --git a/xwords4/wasm/shell_minimal.html b/xwords4/wasm/shell_minimal.html index 7b4f9dea1..42f7ce3ea 100644 --- a/xwords4/wasm/shell_minimal.html +++ b/xwords4/wasm/shell_minimal.html @@ -129,7 +129,8 @@ let arguments = window.location.search.replaceAll('?', '').trim().split('&'); var Module = { - preRun: [], + // preRun: see https://stackoverflow.com/questions/45936800/emscripten-canvas-jquery-toggle-focus/46083467 + preRun: [function () {ENV.SDL_EMSCRIPTEN_KEYBOARD_ELEMENT = "#canvas";}], postRun: [], arguments: arguments, print: (function() {