Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML<;表格>;WASM加载后输入被阻止_Html_C_Forms_Web_Webassembly - Fatal编程技术网

HTML<;表格>;WASM加载后输入被阻止

HTML<;表格>;WASM加载后输入被阻止,html,c,forms,web,webassembly,Html,C,Forms,Web,Webassembly,有人能帮我解决这个问题吗? 我有画布,在html中插入,在C中绘制USNGWebAssembly,但是它似乎阻止了html表单输入字段-一旦wasm模块加载并运行,我就无法键入任何内容 我在C中使用emscripten\u set\u main\u loop\u arg()而不是JS中的requestAnimationFrame(): const int simulate_infinite_loop = 1; // call the function repeatedly const int f

有人能帮我解决这个问题吗? 我有画布,在html中插入,在C中绘制USNGWebAssembly,但是它似乎阻止了html表单输入字段-一旦wasm模块加载并运行,我就无法键入任何内容

我在C中使用emscripten\u set\u main\u loop\u arg()而不是JS中的requestAnimationFrame():

const int simulate_infinite_loop = 1; // call the function repeatedly
const int fps = -1; // call the function as fast as the browser wants to render (typically 60fps)
emscripten_set_main_loop_arg(render, &cbp, fps, simulate_infinite_loop);
稍后,我将其插入HTML:

<script type='text/javascript'>
    var Module = {};
    fetch('app/aghdr.wasm')
    .then(response =>
        response.arrayBuffer()
    ).then(buffer => {
        Module.canvas = document.getElementById("canvas");
        Module.wasmBinary = buffer;
        var script = document.createElement('script');
        script.src = "app/aghdr.js";
        script.onload = function() {
        console.log("Emscripten boilerplate loaded.")
        }
        document.body.appendChild(script);
    });
</script>

var模块={};
获取('app/aghdr.wasm')
。然后(响应=>
response.arrayBuffer()
)。然后(缓冲区=>{
Module.canvas=document.getElementById(“canvas”);
Module.wasmBinary=缓冲区;
var script=document.createElement('script');
script.src=“app/aghdr.js”;
script.onload=函数(){
log(“加载了Emscripten样板文件”)
}
document.body.appendChild(脚本);
});
有人知道,在WASM模块运行时,hot可以确保正常的HTML表单处理消息吗?


请参阅:

可能是由于
emscripten\u set\u keypress\u callback()
引起的。
当参数回调返回非零时,
event.preventDefault()
会阻止按键事件。

谢谢@zakki,我刚刚通过添加:
code
emscripten\u set\u keypress\u回调(0,0,0,0)解决了这个问题;emscripten\u set\u keydown\u回调(0,0,0,0);emscripten\u set\u keyup\u回调(0,0,0,0)<代码>代码