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
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,50 @@ 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
+
Remove callback function
94
+
------------------------
95
+
96
+
In order to remove a callback, previously set via a ``emscripten_set_some_callback`` call, there is a dedicated and generic function for this purpose:
97
+
98
+
.. code-block:: cpp
99
+
100
+
EMSCRIPTEN_RESULT emscripten_remove_callback(
101
+
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
+
The ``eventTypeId`` represents the event type, the same Id received in the callback functions.
0 commit comments