Skip to content

Docs: Mouse events in device orientation and device motion callbacks? #23915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davidhiberbom opened this issue Mar 13, 2025 · 2 comments
Closed

Comments

@davidhiberbom
Copy link
Contributor

.. c:function:: EMSCRIPTEN_RESULT emscripten_get_deviceorientation_status(EmscriptenDeviceOrientationEvent *orientationState)
Returns the most recently received ``deviceorientation`` event state.
Note that for this function call to succeed, :c:func:`emscripten_set_deviceorientation_callback` must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the ``deviceorientation`` state capture.

The docs suggest you need to use to pass mouse events into the device orientation callback. This is a typo, right?

Same thing with device motion:

.. c:function:: EMSCRIPTEN_RESULT emscripten_get_devicemotion_status(EmscriptenDeviceMotionEvent *motionState)
Returns the most recently received `devicemotion <http://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion>`_ event state.
Note that for this function call to succeed, :c:func:`emscripten_set_devicemotion_callback` must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the ``devicemotion`` state capture.

@sbc100
Copy link
Collaborator

sbc100 commented Mar 13, 2025

Looks like a typo yes. Would you have time to send a PR?

@davidhiberbom
Copy link
Contributor Author

#23919

sbc100 pushed a commit that referenced this issue Mar 14, 2025
…ml5.h.rst (#23919)

As suggested in #23915, the docs seem to say you need to pass mouse
events into the devicemotion and deviceorientation callbacks, which
looks like a typo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants