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

Function click_callback

test/browser/test_html5_pointerlockerror.c:41–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39int gotClick = 0;
40
41bool click_callback(int eventType, const EmscriptenMouseEvent *e, void *userData) {
42 if (e->screenX != 0 && e->screenY != 0 && e->clientX != 0 && e->clientY != 0 && e->canvasX != 0 && e->canvasY != 0 && e->targetX != 0 && e->targetY != 0)
43 {
44 if (eventType == EMSCRIPTEN_EVENT_CLICK && !gotClick) {
45 gotClick = 1;
46 printf("Request pointer lock...\n");
47 EMSCRIPTEN_RESULT ret = emscripten_request_pointerlock(0, 0);
48 TEST_RESULT(ret);
49 if (ret != EMSCRIPTEN_RESULT_SUCCESS) {
50 printf("ERROR! emscripten_request_pointerlock() failure\n");
51 report_result(1);
52 }
53 }
54 }
55
56 return 0;
57}
58
59bool pointerlockchange_callback(int eventType, const EmscriptenPointerlockChangeEvent *e, void *userData) {
60 printf("ERROR! received 'pointerlockchange' event\n");

Callers

nothing calls this directly

Calls 2

printfFunction · 0.85
report_resultFunction · 0.70

Tested by

no test coverage detected