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

Function instruction

test/browser/test_html5_mouse.c:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45int gotWheel = 0;
46
47void instruction() {
48 if (!gotClick) { printf("Please click on the canvas.\n"); return; }
49 if (!gotMouseDown) { printf("Please click on the canvas.\n"); return; }
50 if (!gotMouseUp) { printf("Please click on the canvas.\n"); return; }
51 if (!gotDblClick) { printf("Please double-click on the canvas.\n"); return; }
52 if (!gotMouseMove) { printf("Please move the mouse on the canvas.\n"); return; }
53 if (!gotWheel) { printf("Please scroll the mouse wheel.\n"); return; }
54
55 if (gotClick && gotMouseDown && gotMouseUp && gotDblClick && gotMouseMove && gotWheel) {
56 printf("Test successful!\n");
57 emscripten_force_exit(0);
58 }
59}
60
61bool mouse_callback(int eventType, const EmscriptenMouseEvent *e, void *userData) {
62 printf("%s, screen: (%d,%d), client: (%d,%d),%s%s%s%s button: %hu, buttons: %hu, movement: (%d,%d), target: (%d, %d)\n",

Callers 2

mouse_callbackFunction · 0.70
wheel_callbackFunction · 0.70

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected