mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
fix so keyboard input works
Emscripen was hogging all keyboard events even when canvas didn't have focus. There's an arcane way to fix that in js.
This commit is contained in:
parent
74109ce172
commit
88e44d45ff
3 changed files with 6 additions and 5 deletions
|
@ -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; \
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue