Expand description
Input handling for RDPE simulations.
The Input struct provides a clean abstraction over raw window events,
tracking both instantaneous events (key just pressed) and continuous state
(key held down).
§Usage
Input state is available in your update callback via UpdateContext:
ⓘ
.with_update(|ctx| {
// Check if space was just pressed this frame
if ctx.input.key_pressed(KeyCode::Space) {
ctx.set("burst", 1.0);
}
// Check if left mouse is held down
if ctx.input.mouse_held(MouseButton::Left) {
ctx.set("attractor", ctx.input.mouse_ndc());
}
})Structs§
- Input
- Input state tracking for keyboard and mouse.
Enums§
- KeyCode
- Keyboard key codes.
- Mouse
Button - Mouse button identifiers.