OptionaldimensionSlidersFactory: DimensionSlidersFactoryPrivateeventCleanup functions for all registered event listeners
Private_Private OptionalrenderingOptional reference to advanced rendering controls
Private OptionalscaleOptional reference to scale bar overlay
Private OptionalcolormapOptional reference to colormap legend overlay
Private OptionalrecordingOptional reference to recording panel
Private OptionallayersOptional reference to layers panel
Private OptionaluiThe command + panel surface shared with the keyboard bindings. Built in registerAllKeyBindings; exposed via getUiActions.
Private OptionaloverlayOptional reference to overlay manager
PrivateselectedIndex of currently selected dimension for keyboard navigation
Private OptionaldimensionUI component for interactive dimension sliders
Private OptionalanimationAnimation manager for dimension playback
Private OptionalscenesceneDimsManager listener. Stored so dispose / clearDimensionUI can remove it — without this, app dispose (without a subsequent dataset switch) leaves the listener attached to the singleton and retains a disposed InputHandler.
PrivatedebugDebug console for capturing browser console output
PrivatecontextInput context manager for handling keyboard conflicts
PrivatepanelPanel-coordination concern: owns the priority-ordered "close all
panels" flow used by Escape. Constructed in the InputHandler ctor
once debugConsole and animationController are available.
Private OptionalcontrolPrivatewindowWindow-event concern: owns resize / wheel / fullscreenchange. Keyboard listeners stay in InputHandler — they're a separate concern coordinating with InputContextManager.
Private OptionaldimensionOptional factory injected by core/app.ts to construct
DimensionSliders lazily once a scene is loaded. When omitted
(e.g. tests, embedders without nD navigation),
initDimensionSliders() becomes a no-op rather than reaching into
the ui layer directly.
PrivatescenePrivateanimationPrivateperformanceAssociate rendering controls for post-processing and visual effects.
Enables keyboard shortcuts (R, C) to toggle rendering controls panel and cinematic mode. Should be called after rendering controls are created. Optional - rendering controls integration is not required for basic functionality.
Rendering controls UI component providing access to bloom, HDR, noise, and other post-processing effects
Forward a dataset-browser close handle (or undefined to clear it)
to PanelCoordinator so the Escape path closes via the panel's own
close() method — which fires onClose and clears the owner's
LuxarApp.datasetBrowser reference. The O shortcut needs that
reference cleared in order to reopen the panel.
Adopt the control rail (or undefined to clear it on dispose, the
contract the app's teardown relies on). Two duties: the handler keeps the
rail so a keydown the router reports as handled can notify it
(handleRoutedKeyDown — dismisses the first-run hint, refreshes
active-state), and forwards it to PanelCoordinator so the Escape flow
closes the rail's flyout/popover in the right priority order.
Initialize all event listeners for user interaction.
Sets up the complete input handling system including:
Called once during application initialization, after scene manager is created but before scene loading. Re-entry is guarded: a second call logs a warning and returns without re-binding listeners (so HMR / context-restore / test re-setup can't silently double event volume). Event listeners are automatically cleaned up when dispose() is called.
Clear dimension UI and reset dimension manager to initial state.
Disposes of dimension sliders and resets the scene dimension manager. Used when loading a new scene to ensure clean state. The dimension manager is reset to allow it to be reinitialized with new scene metadata.
This is called automatically before loading a new scene. You typically don't need to call this manually unless implementing custom scene switching logic.
Initialize dimension navigation UI after scene loading completes.
This method must be called after the scene is fully loaded and dimension metadata is available. It sets up:
The initialization process ensures all nD objects share the same dimensional coordinate system and respond consistently to navigation. If no nD objects are found in the scene, initialization is skipped gracefully (3D-only scene).
Show the dimension sliders panel (if it exists). Called from viewer_config application.
The dimension animation manager, once a scene with an animatable dimension has been loaded. Undefined for a purely 3D scene, which never builds one — callers must handle that rather than assume it exists.
PrivatemakePrivatesetupPrivate
Set up window-level event listeners for global input handling.
Registers listeners for:
All listeners are bound to class instance and stored for cleanup. Called once during init().
PrivatesetupPrivate
Set up event listeners for THREE.js orbit controls.
Registers listeners on the controls object to trigger animation when user interacts with camera controls (orbit, pan, zoom). Ensures smooth rendering during camera manipulation.
PrivatesetupPrivate
Set up user interaction event listeners for canvas.
Registers listeners for mousedown and touchstart on the canvas to trigger animation when user begins interaction. Provides visual feedback that system is responding to input.
PrivatehandlePrivate
Handle cycling the data loading monitor (hidden → mini → expanded → hidden).
Extracted to a method to support binding registration.
PrivateregisterPrivate
Register all key bindings with the context manager.
This method registers all keyboard shortcuts using the binding registration system. Bindings are organized by input context:
Called during init() to set up the complete keyboard interface.
The command + panel surface the keyboard bindings dispatch into, exposed so on-screen affordances (e.g. the ControlRail) can trigger the exact same actions. Available after init.
PrivateonHandle key down events.
Routes ALL keyboard events through the context manager's binding system. No special cases - everything uses the unified binding system.
PrivateonHandle key up events.
Routes through context manager for keys that have keyupHandler registered. Keys without keyupHandler (most toggle actions) are ignored on keyup.
PrivatetogglePrivate
Toggle help overlay visibility on/off.
Shows or hides the keyboard shortcuts help overlay. Triggered by H key. The help overlay displays all available keyboard shortcuts organized by category (navigation, view controls, panels, etc.).
Registered bindings used to build the keyboard-shortcut overlay.
Register a custom keyboard-routing context.
Remove a custom keyboard-routing context and its bindings.
Register a binding in a built-in or custom context.
Remove a binding from a built-in or custom context.
Optionalmodifiers: { ctrl?: boolean; shift?: boolean; alt?: boolean; meta?: boolean }Activate a nested input context until popContext is called.
Restore the context active before the latest pushContext.
Resolve the active binding label for a registered action.
Enable or disable all routed keyboard input.
PrivatetogglePrivate
Toggle dimension sliders panel visibility.
Shows or hides the nD dimension navigation sliders. Triggered by N key. Only functional if dimension sliders have been initialized (nD dataset loaded). Has no effect for 3D-only datasets.
PrivatetogglePrivate
Toggle performance statistics (FPS, memory) display.
Shows or hides the stats.js performance monitor in top-left corner. Triggered by P key. Displays:
PrivatetogglePrivate
Toggle fullscreen mode on/off.
Requests fullscreen for the document element (true fullscreen including browser chrome). Triggered by Space key (when not focused on UI element) and the View-options fullscreen chip.
Fullscreen exit is also possible via browser's native ESC key handling.
PrivatetogglePrivate
Toggle advanced rendering controls panel visibility.
Shows or hides the rendering controls UI providing access to:
Triggered by R key. Only functional if rendering controls have been associated via setRenderingControls().
PrivatetogglePrivate
Toggle cinematic mode (film-like visual effects).
Enables or disables a preset combination of effects:
Triggered by C key. Provides quick access to cinematic aesthetics without manually adjusting individual effects. Only functional if rendering controls have been associated.
PrivateexportPrivate
Export the complete viewer state as JSON to the clipboard.
Triggered by Ctrl+Shift+S. Captures all rendering settings, camera state,
dimensions, theme, etc. and copies the JSON to the clipboard. The JSON
can be loaded in Python with luxar.ViewerConfig.from_json().
PrivatemakePrivatetogglePrivate
Cycle through camera control modes: Orbit → Fly → Ortho → Orbit.
Triggered by V key. Control modes provide different camera interaction styles:
Updates input context when switching to fly mode to enable WASD keys. Syncs rendering controls display if active.
PrivatesetPrivate
Switch directly to a specific camera control mode (orbit / fly / ortho). Triggered by the control rail's Navigation popover mode selector; reuses the same context/sync wiring as the V-key cycle.
PrivatetogglePrivate
Toggle inertial mode for fly controls (momentum-based movement).
Triggered by I key. Only functional when in fly control mode.
Inertial mode adds physics-based momentum:
Syncs rendering controls display if active. Logs info message if called while not in fly mode.
PrivatemakePrivateshouldPrivate
Check if Space key should trigger fullscreen toggle.
Returns true only if focus is on document body or canvas, preventing fullscreen toggle when user is interacting with UI elements (buttons, inputs, etc.) where Space might have other meanings (submit, type space).
true if Space key should toggle fullscreen, false otherwise
PrivateisPrivate
Check if user is currently typing in a text input field. Thin wrapper
around the pure isTypingInInput helper so callers in this file
keep their compact this.isTypingInInput() shape.
PrivatehandlePrivate
Handles keyboard navigation through nD dimensions using [ and ] keys.
This implements intelligent dimension navigation with adaptive step sizes:
The navigation respects the currently selected dimension (set by number keys) and provides smooth, predictable movement through nD space.
Direction to navigate: -1 for backward, 1 for forward
PrivateselectPrivate
Selects which dimension to control with keyboard navigation.
Number keys (1-9) map to navigable dimensions, allowing users to switch between controlling different non-displayed dimensions with the [ and ] navigation keys.
Zero-based position in the non-displayed dimension list
PrivatehandleEscape-key dispatch. Delegates to PanelCoordinator which owns the recording-priority and fullscreen-defer rules.
PrivaterecenterPrivate
Frame camera to fit the entire scene.
Triggered by F key. Computes bounding box of all visible geometry and repositions camera at the optimal distance to see everything. Works for both perspective (distance) and orthographic (zoom) cameras.
Clean up all event listeners and dispose of managed resources.
Removes all registered event listeners from window, document, and canvas to prevent memory leaks. Disposes of dimension sliders and debug console. Should be called when the input handler is no longer needed (e.g., when destroying the application).
After calling dispose(), the input handler cannot be reused - create a new instance if needed.
Central coordinator for all user input events and nD navigation.
InputHandler