You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/source/docs/api_reference/html5.h.rst
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,54 @@ The ``useCapture`` parameter maps to ``useCapture`` in `EventTarget.addEventLis
90
90
91
91
Most functions return the result using the type :c:data:`EMSCRIPTEN_RESULT`. Zero and positive values denote success. Negative values signal failure. None of the functions fail or abort by throwing a JavaScript or C++ exception. If a particular browser does not support the given feature, the value :c:data:`EMSCRIPTEN_RESULT_NOT_SUPPORTED` will be returned at the time the callback is registered.
92
92
93
+
Unregister function
94
+
-------------------
95
+
96
+
In order to unregister a single event handler callback, call the following function:
const char *target, // ID of the target HTML element.
102
+
void *userData, // User-defined data (passed to the callback).
103
+
int eventTypeId, // The event type ID (EMSCRIPTEN_EVENT_XXX).
104
+
void *callback // Callback function.
105
+
);
106
+
107
+
108
+
The ``target``, ``userData`` and ``callback`` parameters are the same parameters provided in ``emscripten_set_some_callback`` with the only difference being that, since this function applies to all types of callbacks, the type of ``callback`` is ``void *``.
109
+
110
+
Note in particular that the value of ``userData`` will need to match with the call that was used to register the callback. If you are having trouble, double check the value of ``userData``.
111
+
112
+
The ``eventTypeId`` represents the event type, the same Id received in the callback functions.
113
+
114
+
The function returns ``EMSCRIPTEN_RESULT_SUCCESS`` when the event handler callback is removed and ``EMSCRIPTEN_RESULT_INVALID_PARAM`` otherwise.
allowsDeferredCalls: eventTypeString!='mousemove'&&eventTypeString!='mouseenter'&&eventTypeString!='mouseleave',// Mouse move events do not allow fullscreen/pointer lock requests to be handled in them!
0 commit comments