Skip to main content

Module input

Module input 

Source
Expand description

Action-based input system with mode-sensitive key/mouse bindings. Input system: action-based input mapping with mode-sensitive bindings.

Decouples semantic actions (Orbit, Pan, Zoom, …) from physical triggers (key/mouse combinations), enabling future key reconfiguration and context-sensitive controls (Normal / FlyMode / Manipulating).

The new pipeline provides a higher-level, framework-agnostic path:

  1. Translate native events to [ViewportEvent]
  2. Feed into [OrbitCameraController] (or lower-level [ViewportInput])
  3. Call [OrbitCameraController::apply_to_camera] each frame

§Legacy input system (compatibility)

The older [InputSystem] / [FrameInput] query model remains available.

Re-exports§

pub use action::Action;
pub use binding::ActivationMode;
pub use binding::Binding;
pub use binding::KeyCode;
pub use binding::Modifiers;
pub use binding::MouseButton;
pub use binding::Trigger;
pub use binding::TriggerKind;
pub use defaults::default_bindings;
pub use mode::InputMode;
pub use query::ActionState;
pub use query::FrameInput;
pub use action_frame::ActionFrame;
pub use action_frame::NavigationActions;
pub use action_frame::ResolvedActionState;
pub use context::ViewportContext;
pub use controller::OrbitCameraController;
pub use event::ButtonState;
pub use event::ScrollUnits;
pub use event::ViewportEvent;
pub use preset::BindingPreset;
pub use preset::viewport_all_bindings;
pub use viewport_binding::ModifiersMatch;
pub use viewport_binding::ViewportBinding;
pub use viewport_binding::ViewportGesture;
pub use viewport_input::ViewportInput;

Modules§

action
Semantic action enum. Semantic action identifiers for the viewport input system.
action_frame
Per-frame resolved action output. Per-frame resolved action output for the new input pipeline.
binding
Binding, trigger, and modifier types. Input binding types: triggers, modifiers, and bindings that map actions to physical inputs.
context
Per-frame viewport context. Per-frame viewport context for the new input pipeline.
controller
High-level orbit/pan/zoom camera controller. High-level orbit/pan/zoom camera controller.
defaults
Default key/mouse bindings for the viewport.
event
Framework-agnostic viewport events. Framework-agnostic viewport events for the new input pipeline.
mode
Input mode enum (Normal, FlyMode, Manipulating).
preset
Named control presets. Named control presets for the viewport input pipeline.
query
Per-frame input snapshot and action-state query evaluation.
viewport_binding
Viewport gesture and binding types. Viewport gesture and binding types for the new input pipeline.
viewport_input
Stateful viewport input accumulator and resolver. Stateful viewport input accumulator and resolver.

Structs§

InputSystem
Central input system that evaluates action queries against the current binding table and input mode.