pub struct InputEvent {Show 27 fields
pub kind: InputEventKind,
pub mouse_x: f32,
pub mouse_y: f32,
pub mouse_dx: f32,
pub mouse_dy: f32,
pub button: i32,
pub click_count: i32,
pub scroll_x: f32,
pub scroll_y: f32,
pub integer_scroll_x: i32,
pub integer_scroll_y: i32,
pub timestamp_ns: u64,
pub scroll_gesture: ScrollGesture,
pub gesture_scale: f32,
pub pinch_phase: PinchPhase,
pub key: Key,
pub modifiers: InputModifiers,
pub key_repeat: bool,
pub text: String,
pub text_selection_start: i32,
pub text_selection_length: i32,
pub window_w: i32,
pub window_h: i32,
pub gamepad_id: u32,
pub gamepad_button: i32,
pub gamepad_axis: i32,
pub gamepad_value: i32,
}Expand description
Platform-neutral input event. Donor: oa/ui/event.h UiEvent.
Fields§
§kind: InputEventKind§mouse_x: f32Physical pixel pointer position.
mouse_y: f32§mouse_dx: f32Pointer delta from previous position.
mouse_dy: f321 = left, 2 = middle, 3 = right.
click_count: i32§scroll_x: f32Smooth scroll deltas (SDL3 wheel.x/y).
scroll_y: f32§integer_scroll_x: i32Accumulated discrete wheel ticks (SDL3 integer_x/y).
integer_scroll_y: i32§timestamp_ns: u64SDL3 timestamp in nanoseconds (for burst detection).
scroll_gesture: ScrollGesture§gesture_scale: f32Multi-touch pinch — scale relative to Begin (1.0 = no change).
pinch_phase: PinchPhase§key: Key§modifiers: InputModifiers§key_repeat: bool§text: StringCommitted UTF-8 text from platform IME.
text_selection_start: i32§text_selection_length: i32§window_w: i32Resized window pixel dimensions.
window_h: i32§gamepad_id: u32Gamepad instance id — meaningful only on Gamepad* event kinds.
Standard gamepad button code (GAMEPAD_BUTTON_*) — meaningful only
on GamepadButton* event kinds.
gamepad_axis: i32Standard gamepad axis code (GAMEPAD_AXIS_*) — meaningful only on
GamepadAxisMotion.
gamepad_value: i32Axis reading in SDL’s -32768..=32767 range on GamepadAxisMotion.
Implementations§
Source§impl InputEvent
impl InputEvent
pub fn ctrl(&self) -> bool
pub fn shift(&self) -> bool
pub fn alt(&self) -> bool
Sourcepub fn mouse_move(x: f32, y: f32, modifiers: InputModifiers) -> Self
pub fn mouse_move(x: f32, y: f32, modifiers: InputModifiers) -> Self
Construct a pointer-move event.
Sourcepub fn mouse_down(
x: f32,
y: f32,
button: i32,
click_count: i32,
modifiers: InputModifiers,
) -> Self
pub fn mouse_down( x: f32, y: f32, button: i32, click_count: i32, modifiers: InputModifiers, ) -> Self
Construct a pointer-down event.
Sourcepub fn mouse_up(x: f32, y: f32, button: i32, modifiers: InputModifiers) -> Self
pub fn mouse_up(x: f32, y: f32, button: i32, modifiers: InputModifiers) -> Self
Construct a pointer-up event.
Sourcepub fn key_down(key: Key, modifiers: InputModifiers, repeat: bool) -> Self
pub fn key_down(key: Key, modifiers: InputModifiers, repeat: bool) -> Self
Construct a key-down event.
Sourcepub fn key_up(key: Key, modifiers: InputModifiers) -> Self
pub fn key_up(key: Key, modifiers: InputModifiers) -> Self
Construct a key-up event.