Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Module input/handlers/window-event-handler

    Window-event concern extracted from input/input-handler.ts.

    Owns the three window/document-level event handlers the viewer registers on the global scope:

    • resize (window) → forward to SceneManager.updateSize() and kick the animation loop.
    • wheel (window) → orbit-controls own the actual zoom math, so this handler only intercepts Ctrl/Meta+wheel for FOV control and pokes the rendering-controls UI to switch its preset to "Custom" so the slider value reflects the new FOV.
    • fullscreenchange (document) → toggle fullscreen-fitting inline styles on the canvas, then on the next frame run updateSize() once (modern browsers fire this event AFTER the viewport transition completes, so a single rAF is enough).

    The class registers its listeners via attach(cleanups) and pushes the unregistration thunks (plus one that cancels a pending fullscreen resize frame) onto the caller's cleanup array, matching the InputHandler's existing eventListeners ownership model. There's no separate dispose() — the InputHandler runs the cleanup array on its own dispose path.

    The global wheel listener applies rendering behavior only to events from the scene canvas, while still suppressing modifier-wheel page zoom over viewer UI.

    WindowEventHandler