true when focus is on either the document body or the scene canvas,
i.e. the user is "interacting with the scene" rather than a UI panel.
Used to gate global keys like Space (fullscreen toggle) so they don't
fire when the user has clicked into a panel button.
Body-or-canvas instead of just canvas because most pages start with
focus on body and never put it on the canvas explicitly.
Parameters
activeElement: Element|null
Currently focused element, typically
document.activeElement.
truewhen focus is on either the document body or the scene canvas, i.e. the user is "interacting with the scene" rather than a UI panel. Used to gate global keys like Space (fullscreen toggle) so they don't fire when the user has clicked into a panel button.Body-or-canvas instead of just canvas because most pages start with focus on body and never put it on the canvas explicitly.