From 0d839a9767329d818a45a36dddfebe4155c5e92c Mon Sep 17 00:00:00 2001 From: Reuben Dunnington Date: Mon, 18 Sep 2023 19:17:31 -0700 Subject: [PATCH] call oc_on_mouse_wheel() when getting a wheel event --- src/runtime.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/runtime.c b/src/runtime.c index d2928af..2b540c0 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -680,6 +680,20 @@ i32 orca_runloop(void* user) } break; + case OC_EVENT_MOUSE_WHEEL: + { + if(exports[OC_EXPORT_MOUSE_WHEEL]) + { + const void* args[2] = { &event->mouse.deltaX, &event->mouse.deltaY }; + M3Result res = m3_Call(exports[OC_EXPORT_MOUSE_WHEEL], 2, args); + if(res) + { + ORCA_WASM3_ABORT(app->env.m3Runtime, res, "Runtime error"); + } + } + } + break; + case OC_EVENT_MOUSE_MOVE: { if(exports[OC_EXPORT_MOUSE_MOVE]) -- 2.25.1