[−][src]Struct imgui::Io
Settings and inputs/outputs for imgui-rs
Fields
config_flags: ConfigFlags
Flags set by user/application
backend_flags: BackendFlags
Flags set by backend
display_size: [f32; 2]
Main display size in pixels
delta_time: f32
Time elapsed since last frame, in seconds
ini_saving_rate: f32
Minimum time between saving positions/sizes to .ini file, in seconds
mouse_double_click_time: f32
Time for a double-click, in seconds
mouse_double_click_max_dist: f32
Distance threshold to stay in to validate a double-click, in pixels
mouse_drag_threshold: f32
Distance threshold before considering we are dragging
key_map: [u32; 22]
Map of indices into the keys_down
entries array, which represent your "native" keyboard
state
key_repeat_delay: f32
When holding a key/button, time before it starts repeating, in seconds
key_repeat_rate: f32
When holding a key/button, rate at which it repeats, in seconds
font_global_scale: f32
Global scale for all fonts
font_allow_user_scaling: bool
Allow user to scale text of individual window with CTRL+wheel
display_framebuffer_scale: [f32; 2]
For retina display or other situations where window coordinates are different from framebuffer coordinates
mouse_draw_cursor: bool
Request imgui-rs to draw a mouse cursor for you
config_mac_os_behaviors: bool
macOS-style input behavior.
Defaults to true on Apple platforms. Changes in behavior:
- Text editing cursor movement using Alt instead of Ctrl
- Shortcuts using Cmd/Super instead of Ctrl
- Line/text start and end using Cmd+Arrows instead of Home/End
- Double-click selects by word instead of selecting the whole text
- Multi-selection in lists uses Cmd/Super instead of Ctrl
config_input_text_cursor_blink: bool
Set to false to disable blinking cursor
config_windows_resize_from_edges: bool
Enable resizing of windows from their edges and from the lower-left corner.
Requires HasMouserCursors
in backend_flags
, because it needs mouse cursor feedback.
config_windows_move_from_title_bar_only: bool
Set to true to only allow moving windows when clicked+dragged from the title bar.
Windows without a title bar are not affected.
mouse_pos: [f32; 2]
Mouse position, in pixels.
Set to [f32::MAX, f32::MAX] if mouse is unavailable (on another screen, etc.).
mouse_down: [bool; 5]
Mouse buttons: 0=left, 1=right, 2=middle + extras
mouse_wheel: f32
Mouse wheel (vertical).
1 unit scrolls about 5 lines of text.
mouse_wheel_h: f32
Mouse wheel (horizontal).
Most users don't have a mouse with a horizontal wheel, and may not be filled by all backends.
key_ctrl: bool
Keyboard modifier pressed: Control
key_shift: bool
Keyboard modifier pressed: Shift
key_alt: bool
Keyboard modifier pressed: Alt
key_super: bool
Keyboard modifier pressed: Cmd/Super/Windows
keys_down: [bool; 512]
Keyboard keys that are pressed (indexing defined by the user/application)
Gamepad inputs.
Cleared back to zero after each frame. Keyboard keys will be auto-mapped and written
here by frame()
.
want_capture_mouse: bool
When true, imgui-rs will use the mouse inputs, so do not dispatch them to your main game/application
want_capture_keyboard: bool
When true, imgui-rs will use the keyboard inputs, so do not dispatch them to your main game/application
want_text_input: bool
Mobile/console: when true, you may display an on-screen keyboard.
This is set by imgui-rs when it wants textual keyboard input to happen.
want_set_mouse_pos: bool
Mouse position has been altered, so the backend should reposition the mouse on the next frame.
Set only when ConfigFlags::NavEnableSetMousePos
is enabled.
want_save_ini_settings: bool
When manual .ini load/save is active (ini_filename
is None
), this will be set to notify
your application that you can call save_ini_settings
and save the settings yourself.
Important: You need to clear this flag yourself
Directional navigation is currently allowed
Directional navigation is visible and allowed
framerate: f32
Application framerate estimation, in frames per second.
Rolling average estimation based on io.delta_time
over 120 frames.
metrics_render_vertices: i32
Vertices output during last rendering
metrics_render_indices: i32
Indices output during last rendering (= number of triangles * 3)
metrics_render_windows: i32
Number of visible windows
metrics_active_windows: i32
Number of active windows
metrics_active_allocations: i32
Number of active internal imgui-rs allocations
mouse_delta: [f32; 2]
Mouse delta.
Note that this is zero if either current or previous position is invalid ([f32::MAX, f32::MAX]), so a disappearing/reappearing mouse won't have a huge delta.
Implementations
impl Io
[src]
pub fn add_input_character(&mut self, character: char)
[src]
Queue new character input
pub fn clear_input_characters(&mut self)
[src]
Clear character input buffer
pub fn update_delta_time(&mut self, previous: Instant) -> Instant
[src]
Trait Implementations
impl Index<Key> for Io
[src]
impl Index<MouseButton> for Io
[src]
type Output = bool
The returned type after indexing.
fn index(&self, index: MouseButton) -> &bool
[src]
impl Index<NavInput> for Io
[src]
impl IndexMut<Key> for Io
[src]
impl IndexMut<MouseButton> for Io
[src]
fn index_mut(&mut self, index: MouseButton) -> &mut bool
[src]
impl IndexMut<NavInput> for Io
[src]
impl RawCast<ImGuiIO> for Io
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,