How the mouse drives your app. Hovering: the pointer moves freely over the stream, as on a web page, for menus and buttons. Locked: the pointer is captured and moving the mouse turns the camera, as in a game. All three routes can switch it.
| Triggered from | What you call | Works on the production player today |
|---|---|---|
| iframe | post {"cmd":"switchMouseControlSchemeTo","value":"LockedMouse"} to the frame, as a JSON string | Yes |
| Web SDK | e3ds_controller.switchMouseControlSchemeTo("LockedMouse") | Yes |
| Unreal | the plugin's E3DS Change Mouse Control Scheme node, or the same command with Send Pixel Streaming Response | Yes |
All three routes reach the same function in the player. Locked only takes hold on the viewer's next click, because the browser captures the pointer only from a click.
iframe demo: Mouse: Hovering / Locked. Demo manual.
A Web SDK page with the two buttons.
Demo coming soonA sample project that switches when the viewer enters a menu.
Demo coming soonPost the command to the frame. It must be a JSON string: the player parses what it receives, and a plain object is ignored.
var frame = document.getElementById("e3ds");
frame.contentWindow.postMessage(
JSON.stringify({ cmd: "switchMouseControlSchemeTo", value: "LockedMouse" }), "*");
// back to a free pointer
frame.contentWindow.postMessage(
JSON.stringify({ cmd: "switchMouseControlSchemeTo", value: "HoveringMouse" }), "*");
e3ds_controller.switchMouseControlSchemeTo("LockedMouse");
e3ds_controller.switchMouseControlSchemeTo("HoveringMouse");
With the E3DS Features plugin: add BP_E3DS_PS_Actor to your level and call E3DS Change Mouse Control Scheme, choosing HoveringMouse or LockedMouse.
Without the plugin: add a PixelStreamingInput component to an actor and send this with Send Pixel Streaming Response:
{"cmd":"switchMouseControlSchemeTo","value":"LockedMouse"}
{"cmd":"switchMouseControlSchemeTo","value":"HoveringMouse"}
Apps that have both menus and a free camera usually switch as the viewer moves between them.
| What you see | Why | What to do |
|---|---|---|
| Switched to locked, but the pointer is still free | Locked takes hold on the viewer's next click; the browser only captures the pointer from a click. | Expected. Tell the viewer to click into the stream. |
| Nothing happens from the iframe | The message was posted as an object, not a JSON string. | Wrap it in JSON.stringify(...). |
| Nothing happens at all | The value is not exactly HoveringMouse or LockedMouse; anything else is ignored without a message. | Use one of the two exact values. |
| The viewer is stuck in locked mode | Locked keeps the pointer until the page releases it. | The viewer presses Esc, or switch to HoveringMouse. |
The other features, each with the same three ways to call it.
Last updated