summaryrefslogtreecommitdiff
path: root/index.htm
diff options
context:
space:
mode:
Diffstat (limited to 'index.htm')
-rw-r--r--index.htm19
1 files changed, 19 insertions, 0 deletions
diff --git a/index.htm b/index.htm
index 437b932..ada10e2 100644
--- a/index.htm
+++ b/index.htm
@@ -141,6 +141,13 @@
this.program.exports.js_keyup(ev.key, ev.mod);
},
+ wheel : (ev) => {
+ if (this.program === undefined)
+ return;
+
+ this.program.exports.js_wheel(ev.x * -0.01, ev.y * -0.01);
+ },
+
paste : (ev) => {
if (this.program === undefined)
return;
@@ -559,6 +566,18 @@
});
});
+ window.addEventListener("wheel", (ev) => {
+ ev.preventDefault();
+ if (!sound_ready)
+ return;
+
+ sound_node.port.postMessage({
+ id : "wheel",
+ x : ev.deltaX,
+ y : ev.deltaY,
+ });
+ });
+
window.addEventListener("paste", (ev) => {
ev.preventDefault();
if (!sound_ready)