Realm

oa::input::sdl_events

Module published by the oa::input module.

MdRust public API

Public Types

Public Functions

pub fn convert_sdl_event( ev: &Event, pixel_scale_x: f32, pixel_scale_y: f32, ) -> Option<InputEvent>
pub fn window_pixel_scale(window: &Window) -> (f32, f32)

Public Constants & Variables

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

Function Documentation

pub fn convert_sdl_event( ev: &Event, pixel_scale_x: f32, pixel_scale_y: f32 ) -> Option<InputEvent>
Convert one SDL3 event into a InputEvent. pixel_scale_x / pixel_scale_y convert logical SDL coordinates to physical pixels. Obtain them with window_pixel_scale before calling this. Returns None for SDL events that have no UI representation (timers, audio device changes, etc.).
pub fn window_pixel_scale(window: &Window) -> ( f32, f32 )
Compute logical→physical pixel scale for one window. Returns (scale_x, scale_y). Both default to 1.0 when the window is zero-size or the query fails.