MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / wheel_callback

Function wheel_callback

test/browser/test_html5_mouse.c:85–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85bool wheel_callback(int eventType, const EmscriptenWheelEvent *e, void *userData) {
86 printf("%s, screen: (%d,%d), client: (%d,%d),%s%s%s%s button: %hu, buttons: %hu, target: (%d, %d), delta:(%g,%g,%g), deltaMode:%u\n",
87 emscripten_event_type_to_string(eventType), e->mouse.screenX, e->mouse.screenY, e->mouse.clientX, e->mouse.clientY,
88 e->mouse.ctrlKey ? " CTRL" : "", e->mouse.shiftKey ? " SHIFT" : "", e->mouse.altKey ? " ALT" : "", e->mouse.metaKey ? " META" : "",
89 e->mouse.button, e->mouse.buttons, e->mouse.targetX, e->mouse.targetY,
90 (float)e->deltaX, (float)e->deltaY, (float)e->deltaZ, e->deltaMode);
91
92 if (e->deltaY > 0.f || e->deltaY < 0.f)
93 gotWheel = 1;
94
95 instruction();
96 return 0;
97}
98
99int main() {
100 // Make the canvas area stand out from the background.

Callers

nothing calls this directly

Calls 3

printfFunction · 0.85
instructionFunction · 0.70

Tested by

no test coverage detected