pub struct RenderInput {Show 22 fields
pub forward: bool,
pub backward: bool,
pub left: bool,
pub right: bool,
pub sprint: bool,
pub interact: bool,
pub jump: bool,
pub ctrl: bool,
pub alt: bool,
pub cmd: bool,
pub mouse_dx: f32,
pub mouse_dy: f32,
pub scroll_delta: f32,
pub mouse_x: f32,
pub mouse_y: f32,
pub left_click: bool,
pub left_button_down: bool,
pub right_click: bool,
pub hud_toggle: bool,
pub escape: bool,
pub captured_key: Option<InputKey>,
pub typed_char: Option<char>,
}Expand description
Accumulated input state since the last poll. Drained and reset every frame by GraphicsSystem and converted into a FrameInput component for Camera3DSystem to consume.
Fields§
§forward: boolForward movement key held.
backward: boolBackward movement key held.
left: boolLeft strafe key held.
right: boolRight strafe key held.
sprint: boolSprint key held.
interact: boolTrue for exactly one frame per interact-key press.
jump: boolTrue for exactly one frame per jump-key press.
ctrl: boolTrue while the Control key is held. A UI modifier (a story fast-forwards
its dialogue while it is down); not gated by menu state, like escape and
captured_key. Wired on Metal; DirectX / Vulkan set it from their key
callbacks.
alt: boolTrue while the Option/Alt key is held. A UI modifier (the editor’s orbit
drag); not gated by menu state, like ctrl. Wired on Metal; DirectX /
Vulkan set it from their key callbacks.
cmd: boolTrue while the platform’s command modifier is held: the Command key on macOS, where it is the idiomatic modifier for an application shortcut. Windows and Linux leave this false and keep Ctrl as their shortcut modifier, because the Super key there belongs to the desktop shell.
mouse_dx: f32Accumulated mouse delta since the last take_input() call.
mouse_dy: f32Accumulated vertical mouse delta since the last take_input().
scroll_delta: f32Accumulated vertical scroll-wheel delta since the last take_input(). Only delivered while the cursor is free.
mouse_x: f32Absolute cursor position in window pixels (origin top-left). Only meaningful when the cursor is not captured.
mouse_y: f32Absolute cursor y in window pixels, origin top-left.
left_click: boolTrue for exactly one frame when the left mouse button is pressed while the cursor is not captured.
True while the left mouse button is held (cursor not captured). Persists across frames until release so a UI drag can track the cursor.
right_click: boolTrue for exactly one frame when the right mouse button is pressed while the cursor is not captured. Wired on Metal; DirectX / Vulkan set it from their mouse callbacks.
hud_toggle: boolTrue for exactly one frame when the HUD-toggle key is pressed (F1).
escape: boolTrue for exactly one frame when Escape is pressed while the cursor is not captured. (In captured-cursor worlds Escape continues to release the cursor, as before, and this pulse stays false.)
captured_key: Option<InputKey>The canonical key pressed this poll, for the settings-menu rebind
capture, or None. A one-frame pulse, surfaced regardless of menu /
capture state. Wired on Metal; DirectX / Vulkan set it from their key
callbacks.
typed_char: Option<char>The printable character produced by this poll’s key press (with the OS’s
shift / dead-key / layout handling applied), for text-input fields, or
None. A one-frame pulse like captured_key, ungated by menu / capture
state. Editing keys (Backspace / Delete / arrows) are not here: those
arrive via captured_key. Wired on Metal; DirectX / Vulkan set it from
their WM_CHAR / char callback when built on Windows / Linux.
Trait Implementations§
Source§impl Clone for RenderInput
impl Clone for RenderInput
Source§fn clone(&self) -> RenderInput
fn clone(&self) -> RenderInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more