Realm

oa::input

input module in the OA Core public surface.

MdRust public API

Public Types

Public Functions

pub fn clear_for_next_frame()
pub fn down(button: Button) -> bool
pub fn initialize()
pub fn keyboard<R>(read: impl FnOnce(&KeyboardState) -> R) -> R
pub fn mouse<R>(read: impl FnOnce(&MouseState) -> R) -> R
pub fn pointer_position() -> (f32, f32)
pub fn press(button: Button) -> bool
pub fn process_event(event: &Event)
pub fn release(button: Button) -> bool
pub fn shutdown()
pub fn update()

Public Constants & Variables

pub const INPUT_MOD_ALT: InputModifiers = _; // 4u32
pub const INPUT_MOD_CTRL: InputModifiers = _; // 2u32
pub const INPUT_MOD_NONE: InputModifiers = 0;
pub const INPUT_MOD_SHIFT: InputModifiers = _; // 1u32
pub const INPUT_MOD_SUPER: InputModifiers = _; // 8u32

Function Documentation

pub fn clear_for_next_frame()
Clear per-frame deltas (scroll, motion delta, press/release edges).
pub fn down( button: Button ) -> bool
Return whether button is currently held.
pub fn initialize()
Initialize the input backend. Idempotent. Prefers native pinch gestures and precise wheel deltas on Wayland; the touchpad stays pointer/wheel input rather than raw touch.
pub fn keyboard<R>( read: impl FnOnce(&KeyboardState) -> R ) -> R
Access the current keyboard held-state snapshot.
pub fn mouse<R>( read: impl FnOnce(&MouseState) -> R ) -> R
Access the current pointer-state snapshot.
pub fn pointer_position() -> ( f32, f32 )
Last known pointer position, updated on motion, buttons, and wheel.
pub fn press( button: Button ) -> bool
Return whether button went down since the last update. Remains valid until clear_for_next_frame.
pub fn process_event( event: &Event )
Feed one raw platform event into the per-frame snapshot. Mouse motion/buttons/wheel fold into the pointer state; key down/up sets the scancode-indexed held bits. Press/release edges are derived by update. Donor: oa::input::processEvent.
pub fn release( button: Button ) -> bool
Return whether button went up since the last update. Remains valid until clear_for_next_frame.
pub fn update()
Fold queued events into held/rising/falling edges. Call once per frame after all process_event calls and before reading press/release.